[gnome-music: 1/2] Use rtl variants of icons when using RTL languages



commit 8cf2ee685cb63b155a2283f4ac830d303803b555
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Mon Aug 12 00:06:41 2013 +0800

    Use rtl variants of icons when using RTL languages

 gnomemusic/player.py  |    7 +++++++
 gnomemusic/toolbar.py |    3 +++
 gnomemusic/view.py    |    5 ++++-
 gnomemusic/widgets.py |    5 ++++-
 4 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index f2a1530..c5f462b 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -361,6 +361,13 @@ class Player(GObject.GObject):
         self.progressScale.connect('value-changed', self._on_progress_value_changed)
         self.progressScale.connect('button-release-event', self._on_progress_scale_button_released)
 
+        if Gtk.Widget.get_default_direction() is Gtk.TextDirection.RTL:
+            self._prevImage = self._ui.get_object('previous_image')
+            self._nextImage = self._ui.get_object('next_image')
+            self._prevImage.set_property('icon-name', 'media-skip-backward-rtl-symbolic')
+            self._nextImage.set_property('icon-name', 'media-skip-forward-rtl-symbolic')
+            self._playImage.set_property('icon-name', 'media-playback-start-rtl-symbolic')
+
     def _on_progress_scale_button_released(self, scale, data):
         self.on_progress_scale_change_value(self.progressScale)
         self._update_position_callback()
diff --git a/gnomemusic/toolbar.py b/gnomemusic/toolbar.py
index 32179b2..610881f 100644
--- a/gnomemusic/toolbar.py
+++ b/gnomemusic/toolbar.py
@@ -38,6 +38,9 @@ class Toolbar(GObject.GObject):
         self._selection_menu_button.set_relief(Gtk.ReliefStyle.NONE)
         self.header_bar.set_custom_title(self._stack_switcher)
         self._search_button = self._ui.get_object('search-button')
+        if Gtk.Widget.get_default_direction() is Gtk.TextDirection.RTL:
+            _back_button_image = self._ui.get_object('back-button-image')
+            _back_button_image.set_property('icon-name', 'go-previous-rtl-symbolic')
         self._back_button.connect('clicked', self.on_back_button_clicked)
         self._close_button.connect('clicked', self._close_button_clicked)
         if Gtk.get_minor_version() <= 8:
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 3d5031d..a39f080 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -20,7 +20,10 @@ else:
 
 
 class ViewContainer(Stack):
-    nowPlayingIconName = 'media-playback-start-symbolic'
+    if Gtk.Widget.get_default_direction() is not Gtk.TextDirection.RTL:
+        nowPlayingIconName = 'media-playback-start-symbolic'
+    else:
+        nowPlayingIconName = 'media-playback-start-rtl-symbolic'
     errorIconName = 'dialog-error-symbolic'
     starIconName = 'starred-symbolic'
     countQuery = None
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index 4d0f4a2..4829ef7 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -10,7 +10,10 @@ from gnomemusic.albumArtCache import AlbumArtCache
 
 tracker = Tracker.SparqlConnection.get(None)
 ALBUM_ART_CACHE = AlbumArtCache.get_default()
-NOW_PLAYING_ICON_NAME = 'media-playback-start-symbolic'
+if Gtk.Widget.get_default_direction() is not Gtk.TextDirection.RTL:
+    NOW_PLAYING_ICON_NAME = 'media-playback-start-symbolic'
+else:
+    NOW_PLAYING_ICON_NAME = 'media-playback-start-rtl-symbolic'
 ERROR_ICON_NAME = 'dialog-error-symbolic'
 
 


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