[easytag/wip/future-gtk: 2/3] Use resource property on GtkImage
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/future-gtk: 2/3] Use resource property on GtkImage
- Date: Fri, 9 Jan 2015 20:13:16 +0000 (UTC)
commit 574e6f5eaf8698099a0c9b84eef07da2e4f80189
Author: David King <amigadave amigadave com>
Date: Fri Jan 9 20:09:58 2015 +0000
Use resource property on GtkImage
Added in GTK+ 3.8.
data/toolbar.ui | 12 ++++++++++--
src/application_window.c | 9 ---------
2 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/data/toolbar.ui b/data/toolbar.ui
index 6adb884..f1d9eb6 100644
--- a/data/toolbar.ui
+++ b/data/toolbar.ui
@@ -1,4 +1,12 @@
<interface domain="easytag">
+ <object class="GtkImage" id="artist_view_image">
+ <property name="resource">/org/gnome/EasyTAG/images/artist.png</property>
+ <property name="visible">True</property>
+ </object>
+ <object class="GtkImage" id="invert_selection_image">
+ <property name="resource">/org/gnome/EasyTAG/images/invert-selection.png</property>
+ <property name="visible">True</property>
+ </object>
<object class="GtkToolbar" id="main_toolbar">
<property name="visible">True</property>
<style>
@@ -106,7 +114,7 @@
<property name="action-name">win.file-artist-view</property>
<property name="action-target">'artist'</property>
<property name="label" translatable="yes">Artists and Albums</property>
- <!--<property name="icon-widget">artist_view_image</property>-->
+ <property name="icon-widget">artist_view_image</property>
<property name="tooltip-text" translatable="yes">Browse artists and albums</property>
<property name="visible">True</property>
</object>
@@ -118,7 +126,7 @@
<object class="GtkToolButton" id="invert_selection_button">
<property name="action-name">win.invert-selection</property>
<property name="label" translatable="yes">Invert File Selection</property>
- <!--<property name="stock-id">easytag-invert-selection</property>-->
+ <property name="icon-widget">invert_selection_image</property>
<property name="tooltip-text" translatable="yes">Invert file selection</property>
<property name="visible">True</property>
</object>
diff --git a/src/application_window.c b/src/application_window.c
index ffa7cff..31f76c6 100644
--- a/src/application_window.c
+++ b/src/application_window.c
@@ -1702,7 +1702,6 @@ et_application_window_init (EtApplicationWindow *self)
GtkBuilder *builder;
GError *error = NULL;
GtkWidget *toolbar;
- GtkToolButton *button;
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder,
@@ -1718,14 +1717,6 @@ et_application_window_init (EtApplicationWindow *self)
toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "main_toolbar"));
gtk_box_pack_start (GTK_BOX (main_vbox), toolbar, FALSE, FALSE, 0);
- /* TODO: Use resource property on GtkImage when using GTK+ > 3.8. */
- button = GTK_TOOL_BUTTON (gtk_builder_get_object (builder, "artist_view_button"));
- gtk_tool_button_set_icon_widget (button,
- gtk_image_new_from_resource
("/org/gnome/EasyTAG/images/artist.png"));
- button = GTK_TOOL_BUTTON (gtk_builder_get_object (builder, "invert_selection_button"));
- gtk_tool_button_set_icon_widget (button,
- gtk_image_new_from_resource
("/org/gnome/EasyTAG/images/invert-selection.png"));
-
g_object_unref (builder);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]