Ticket #306: 40001-Mirror-arrow-icons-when-running-in-RTL-mode-SL-306.txt

File 40001-Mirror-arrow-icons-when-running-in-RTL-mode-SL-306.txt, 2.0 KB (added by seeta, 13 years ago)
Line 
1From 61ad152dcca127ff6f3c081ea944291e9e1eaec5 Mon Sep 17 00:00:00 2001
2From: anubhav <anubhav@dev.seeta.in>
3Date: Sat, 2 Oct 2010 21:17:51 +0530
4Subject: [PATCH] Mirror arrow icons when running in RTL mode(SL#306)
5
6This patch inserts a if condition in the intiallization of the the class of the
7toolbar.Which check for the direction of the language is right to left or
8left to right thus reverting the buttons of toolbar (in the case of rtl )
9This patch handels the problem with read toolbar in read activity
10---
11 source/read/readtoolbar.py |   12 ++++++++++--
12 1 files changed, 10 insertions(+), 2 deletions(-)
13
14diff --git a/source/read/readtoolbar.py b/source/read/readtoolbar.py
15index 53a756f..bc6f9ef 100644
16--- a/source/read/readtoolbar.py
17+++ b/source/read/readtoolbar.py
18@@ -37,6 +37,14 @@ class EditToolbar(activity.EditToolbar):
19         activity.EditToolbar.__init__(self)
20 
21         self._evince_view = None
22+       
23+        if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL:
24+           self.nextbutton = 'go-previous-paired'
25+           self.previousbutton = 'go-next-paired'
26+                     
27+        else :
28+           self.nextbutton = 'go-next-paired'
29+           self.previousbutton = 'go-previous-paired'
30 
31         self._document = None
32         self._find_job = None
33@@ -60,14 +68,14 @@ class EditToolbar(activity.EditToolbar):
34         self.insert(search_item, -1)
35         search_item.show()
36 
37-        self._prev = ToolButton('go-previous-paired')
38+        self._prev = ToolButton(self.previousbutton)
39         self._prev.set_tooltip(_('Previous'))
40         self._prev.props.sensitive = False
41         self._prev.connect('clicked', self._find_prev_cb)
42         self.insert(self._prev, -1)
43         self._prev.show()
44 
45-        self._next = ToolButton('go-next-paired')
46+        self._next = ToolButton(self.nextbutton)
47         self._next.set_tooltip(_('Next'))
48         self._next.props.sensitive = False
49         self._next.connect('clicked', self._find_next_cb)
50--
511.7.0.4
52