[easytag/wip/musicbrainz-support-merge: 74/75] Set Images from resource



commit cc8483769b5e0851a5e37ffffd968881acd02fe3
Author: Abhinav <abhijangda hotmail com>
Date:   Thu Aug 21 22:54:29 2014 +0530

    Set Images from resource
    
    Use gtk_image_new_from_resource to set image as an icon to toolbar buttons

 data/musicbrainz_dialog.ui |   18 ------------------
 src/musicbrainz_dialog.c   |   15 +++++++++++++++
 2 files changed, 15 insertions(+), 18 deletions(-)
---
diff --git a/data/musicbrainz_dialog.ui b/data/musicbrainz_dialog.ui
index 79912fc..779ccd4 100755
--- a/data/musicbrainz_dialog.ui
+++ b/data/musicbrainz_dialog.ui
@@ -6,21 +6,6 @@
     <property name="can_focus">False</property>
     <property name="stock">gtk-find</property>
   </object>
-  <object class="GtkImage" id="img_invert_selection">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">easytag-invert-selection</property>
-  </object>
-  <object class="GtkImage" id="img_red_lines">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">easytag-red-lines</property>
-  </object>
-  <object class="GtkImage" id="img_unselect_all">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">easytag-unselect-all</property>
-  </object>
   <object class="GtkBox" id="mb_box">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -196,7 +181,6 @@
                     <property name="tooltip_text" translatable="yes">Invert Selections</property>
                     <property name="label" translatable="yes">toolbutton5</property>
                     <property name="use_underline">True</property>
-                    <property name="icon_widget">img_invert_selection</property>
                   </object>
                   <packing>
                     <property name="expand">True</property>
@@ -230,7 +214,6 @@
                     <property name="tooltip_text" translatable="yes">Unselect All</property>
                     <property name="label" translatable="yes">toolbutton7</property>
                     <property name="use_underline">True</property>
-                    <property name="icon_widget">img_unselect_all</property>
                   </object>
                   <packing>
                     <property name="expand">True</property>
@@ -247,7 +230,6 @@
                     <property name="tooltip_text" translatable="yes">Toggle Red Lines</property>
                     <property name="label" translatable="yes">toolbutton8</property>
                     <property name="use_underline">True</property>
-                    <property name="icon_widget">img_red_lines</property>
                   </object>
                   <packing>
                     <property name="expand">True</property>
diff --git a/src/musicbrainz_dialog.c b/src/musicbrainz_dialog.c
index d54c348..6db4d81 100755
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -2398,8 +2398,10 @@ et_musicbrainz_dialog_init (EtMusicBrainzDialog *dialog)
     GtkWidget *cb_manual_search_in;
     GtkWidget *entry_manual_search;
     GtkWidget *box;
+    GtkWidget *image;
     GError *error;
     ET_File *et_file;
+    GtkToolButton *button;
 
     priv = dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
                                                        et_musicbrainz_dialog_get_type (),
@@ -2488,6 +2490,19 @@ et_musicbrainz_dialog_init (EtMusicBrainzDialog *dialog)
 
     gtk_combo_box_set_active (GTK_COMBO_BOX (cb_manual_search_in), 1);
 
+    /* Set Icons to Toolbar Items */
+    button = GTK_TOOL_BUTTON (gtk_builder_get_object (builder, "toolbtn_invert_selection"));
+    image = gtk_image_new_from_resource ("/org/gnome/EasyTAG/images/invert-selection.png");
+    gtk_widget_set_sensitive (image, FALSE);
+    gtk_tool_button_set_icon_widget (button, image);
+    gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE);
+    button = GTK_TOOL_BUTTON (gtk_builder_get_object (builder, "toolbtn_unselect_all"));
+    gtk_tool_button_set_icon_widget (button,
+                                     gtk_image_new_from_resource 
("/org/gnome/EasyTAG/images/unselect-all.png"));
+    button = GTK_TOOL_BUTTON (gtk_builder_get_object (builder, "toolbtn_toggle_red_lines"));
+    gtk_tool_button_set_icon_widget (button,
+                                     gtk_image_new_from_resource 
("/org/gnome/EasyTAG/images/red-lines.png"));
+
     /* Set the text of cb_manual_search to the album of selected file */
     get_first_selected_file (&et_file);
 


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