[gtk+] filechooser: Use GtkButton's icon-name property



commit 01723fa02faf37d729cee059bcd3e1d39230dd24
Author: Timm Bäder <mail baedert org>
Date:   Sat Oct 29 10:07:15 2016 +0200

    filechooser: Use GtkButton's icon-name property

 gtk/gtkfilechooserdialog.c     |    7 +------
 gtk/ui/gtkfilechooserwidget.ui |    8 +-------
 2 files changed, 2 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index db1d8f6..59026b5 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -484,17 +484,12 @@ setup_search (GtkFileChooserDialog *dialog)
   if (use_header)
     {
       GtkWidget *button;
-      GtkWidget *image;
       GtkWidget *header;
 
       button = gtk_toggle_button_new ();
       gtk_widget_set_focus_on_click (button, FALSE);
       gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
-      image = gtk_image_new_from_icon_name ("edit-find-symbolic", GTK_ICON_SIZE_MENU);
-      gtk_container_add (GTK_CONTAINER (button), image);
-      gtk_style_context_add_class (gtk_widget_get_style_context (button), "image-button");
-      gtk_style_context_remove_class (gtk_widget_get_style_context (button), "text-button");
-      gtk_widget_show (image);
+      gtk_button_set_icon_name (GTK_BUTTON (button), "edit-find-symbolic");
       gtk_widget_show (button);
 
       header = gtk_dialog_get_header_bar (GTK_DIALOG (dialog));
diff --git a/gtk/ui/gtkfilechooserwidget.ui b/gtk/ui/gtkfilechooserwidget.ui
index 8ff35f3..0d2f050 100644
--- a/gtk/ui/gtkfilechooserwidget.ui
+++ b/gtk/ui/gtkfilechooserwidget.ui
@@ -69,14 +69,8 @@
                                     <property name="tooltip-text" translatable="yes">Create Folder</property>
                                     <property name="use-underline">1</property>
                                     <property name="popover">new_folder_popover</property>
+                                    <property name="icon-name">folder-new-symbolic</property>
                                     <signal name="notify::active" handler="new_folder_popover_active"/>
-                                    <child>
-                                      <object class="GtkImage">
-                                        <property name="visible">1</property>
-                                        <property name="icon-name">folder-new-symbolic</property>
-                                        <property name="icon-size">1</property>
-                                      </object>
-                                    </child>
                                   </object>
                                   <packing>
                                     <property name="fill">0</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]