From 612b5df238c40e69d7306d14b05198ab50895053 Mon Sep 17 00:00:00 2001 From: anubhav Date: Sat, 2 Oct 2010 21:36:07 +0530 Subject: [PATCH] Mirror arrow icons when running in RTL mode(#306) This patch inserts a if condition in the intiallization of the the class of the toolbar.Which check for the direction of the language is right to left or left to right thus reverting the buttons of toolbar (in the case of rtl ) This patch handels the problem with the log viewer bar in log activity --- source/log/logviewer.py | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/source/log/logviewer.py b/source/log/logviewer.py index cdd77ed..fcb5a86 100644 --- a/source/log/logviewer.py +++ b/source/log/logviewer.py @@ -324,7 +324,15 @@ class LogActivity(activity.Activity): def __init__(self, handle): activity.Activity.__init__(self, handle) self.set_title(_('Log')) - + + if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL: + self.nextbutton = 'go-previous-paired' + self.previousbutton = 'go-next-paired' + + else : + self.nextbutton = 'go-next-paired' + self.previousbutton = 'go-previous-paired' + # Paths to watch: ~/.sugar/someuser/logs, /var/log paths = [] paths.append(env.get_profile_path('logs')) @@ -377,12 +385,12 @@ class LogActivity(activity.Activity): search_item.add(search_entry) toolbar_box.toolbar.insert(search_item, -1) - self._search_prev = ToolButton('go-previous-paired') + self._search_prev = ToolButton(self.previousbutton) self._search_prev.set_tooltip(_('Previous')) self._search_prev.connect('clicked', self._search_prev_cb) toolbar_box.toolbar.insert(self._search_prev, -1) - self._search_next = ToolButton('go-next-paired') + self._search_next = ToolButton(self.nextbutton) self._search_next.set_tooltip(_('Next')) self._search_next.connect('clicked', self._search_next_cb) toolbar_box.toolbar.insert(self._search_next, -1) -- 1.7.0.4