[gnome-chess] Use symbolic icons in the buttom bar



commit 03fd2ee281d42fa250112174076fc62e2eb304a7
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Tue Jan 7 13:51:40 2014 +0200

    Use symbolic icons in the buttom bar

 data/gnome-chess.ui  |    4 ----
 src/gnome-chess.vala |   11 +++++++++++
 2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/data/gnome-chess.ui b/data/gnome-chess.ui
index 723f90a..83233dc 100644
--- a/data/gnome-chess.ui
+++ b/data/gnome-chess.ui
@@ -76,7 +76,6 @@
                           <object class="GtkImage" id="first_move_image">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="stock">gtk-goto-first</property>
                           </object>
                         </child>
                       </object>
@@ -99,7 +98,6 @@
                           <object class="GtkImage" id="prev_move_image">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="stock">gtk-go-back</property>
                           </object>
                         </child>
                       </object>
@@ -122,7 +120,6 @@
                           <object class="GtkImage" id="next_move_image">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="stock">gtk-go-forward</property>
                           </object>
                         </child>
                       </object>
@@ -145,7 +142,6 @@
                           <object class="GtkImage" id="last_move_image">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="stock">gtk-goto-last</property>
                           </object>
                         </child>
                       </object>
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index d7bf6e4..902e075 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -132,6 +132,10 @@ public class Application : Gtk.Application
         prev_move_button = (Gtk.Widget) builder.get_object ("prev_move_button");
         next_move_button = (Gtk.Widget) builder.get_object ("next_move_button");
         last_move_button = (Gtk.Widget) builder.get_object ("last_move_button");
+        var first_move_image = (Gtk.Image) builder.get_object ("first_move_image");
+        var prev_move_image = (Gtk.Image) builder.get_object ("prev_move_image");
+        var next_move_image = (Gtk.Image) builder.get_object ("next_move_image");
+        var last_move_image = (Gtk.Image) builder.get_object ("last_move_image");
         history_combo = (Gtk.ComboBox) builder.get_object ("history_combo");
         white_time_label = (Gtk.Widget) builder.get_object ("white_time_label");
         black_time_label = (Gtk.Widget) builder.get_object ("black_time_label");
@@ -140,6 +144,13 @@ public class Application : Gtk.Application
         headerbar = (Gtk.HeaderBar) builder.get_object ("headerbar");
         builder.connect_signals (this);
 
+        bool rtl = Gtk.Widget.get_default_direction () == Gtk.TextDirection.RTL;
+
+        first_move_image.icon_name = rtl ? "go-first-rtl-symbolic" : "go-first-symbolic";
+        prev_move_image.icon_name = rtl ? "go-previous-rtl-symbolic" : "go-previous-symbolic";
+        next_move_image.icon_name = rtl ? "go-next-rtl-symbolic" : "go-next-symbolic";
+        last_move_image.icon_name = rtl ? "go-last-rtl-symbolic" : "go-last-symbolic";
+
         window.add_action_entries (window_entries, this);
         window.icon_name = "gnome-chess";
         add_window (window);


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