From 64718888dd1c6b29d09d1ed13f86c14d61b5353e Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Wed, 11 May 2016 22:30:10 +0530 Subject: [PATCH] dialog: resize icon on linux before showing --- atom/browser/ui/message_box_gtk.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/atom/browser/ui/message_box_gtk.cc b/atom/browser/ui/message_box_gtk.cc index 9615e95..6d0bff3 100644 --- a/atom/browser/ui/message_box_gtk.cc +++ b/atom/browser/ui/message_box_gtk.cc @@ -53,9 +53,16 @@ class GtkMessageBox { // Set dialog's icon. if (!icon.isNull()) { GdkPixbuf* pixbuf = libgtk2ui::GdkPixbufFromSkBitmap(*icon.bitmap()); - GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf); + GtkIconSource* iconsource = gtk_icon_source_new(); + GtkIconSet* iconset = gtk_icon_set_new(); + gtk_icon_source_set_pixbuf(iconsource, pixbuf); + gtk_icon_set_add_source(iconset, iconsource); + GtkWidget* image = gtk_image_new_from_icon_set(iconset, + GTK_ICON_SIZE_DIALOG); gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(dialog_), image); gtk_widget_show(image); + gtk_icon_source_free(iconsource); + gtk_icon_set_unref(iconset); g_object_unref(pixbuf); } -- 2.7.4