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

File 20001-Mirror-arrow-icons-when-running-in-RTL-mode-306.txt, 2.1 KB (added by seeta, 12 years ago)
Line 
1From 6c0c55375d78389a7bd1f481999f266fe0453ec4 Mon Sep 17 00:00:00 2001
2From: anubhav <anubhav@dev.seeta.in>
3Date: Sat, 2 Oct 2010 21:38:16 +0530
4Subject: [PATCH] Mirror arrow icons when running in RTL mode(#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 toolbar of write activity.
10---
11 source/write/toolbar.py |   13 +++++++++----
12 1 files changed, 9 insertions(+), 4 deletions(-)
13
14diff --git a/source/write/toolbar.py b/source/write/toolbar.py
15index 75243c7..d723ceb 100644
16--- a/source/write/toolbar.py
17+++ b/source/write/oolbar.py
18@@ -42,9 +42,14 @@ class EditToolbar(gtk.Toolbar):
19     def __init__(self, pc, toolbar_box):
20     
21         gtk.Toolbar.__init__(self)
22-
23         self._abiword_canvas = pc.abiword_canvas
24-
25+        if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL:
26+           self.nextbutton = 'go-previous-paired'
27+           self.previousbutton = 'go-next-paired'
28+                     
29+        else :
30+           self.nextbutton = 'go-next-paired'
31+           self.previousbutton = 'go-previous-paired'
32         copy = CopyButton()
33         copy.props.accelerator = '<Ctrl>C'
34         copy.connect('clicked', lambda button: pc.abiword_canvas.copy())
35@@ -102,13 +107,13 @@ class EditToolbar(gtk.Toolbar):
36         self._search_entry.add_clear_button()
37         self._add_widget(self._search_entry, expand=True)
38 
39-        self._findprev = ToolButton('go-previous-paired')
40+        self._findprev = ToolButton(self.previousbutton)
41         self._findprev.set_tooltip(_('Find previous'))
42         self.insert(self._findprev, -1)
43         self._findprev.show()
44         self._findprev.connect('clicked', self._findprev_cb)
45 
46-        self._findnext = ToolButton('go-next-paired')
47+        self._findnext = ToolButton(self.nextbutton)
48         self._findnext.set_tooltip(_('Find next'))
49         self.insert(self._findnext, -1)
50         self._findnext.show()
51--
521.7.0.4
53