8000 fix: set size of GTK about panel icon by trop[bot] · Pull Request #19581 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: set size of GTK about panel icon #19581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion atom/browser/browser_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ void Browser::ShowAboutPanel() {
gtk_about_dialog_set_website(dialog, website.c_str());
if (about_panel_options_.GetString("iconPath", &icon_path)) {
GError* error = nullptr;
GdkPixbuf* icon = gdk_pixbuf_new_from_file(icon_path.c_str(), &error);
constexpr int width = 64; // width of about panel icon in pixels
constexpr int height = 64; // height of about panel icon in pixels

// set preserve_aspect_ratio to true
GdkPixbuf* icon = gdk_pixbuf_new_from_file_at_size(icon_path.c_str(), width,
height, &error);
if (error != nullptr) {
g_warning("%s", error->message);
g_clear_error(&error);
Expand Down
2 changes: 1 addition & 1 deletion docs/api/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ Show the app's about panel options. These options can be overridden with `app.se
* `version` String (optional) - The app's build version number. _macOS_
* `credits` String (optional) - Credit information. _macOS_
* `website` String (optional) - The app's website. _Linux_
* `iconPath` String (optional) - Path to the app's icon. _Linux_
* `iconPath` String (optional) - Path to the app's icon. Will be shown as 64x64 pixels while retaining aspect ratio. _Linux_

Set the about panel options. This will override the values defined in the app's
`.plist` file on MacOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
Expand Down
0