From 6c0c55375d78389a7bd1f481999f266fe0453ec4 Mon Sep 17 00:00:00 2001 From: anubhav Date: Sat, 2 Oct 2010 21:38:16 +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 toolbar of write activity. --- source/write/toolbar.py | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/write/toolbar.py b/source/write/toolbar.py index 75243c7..d723ceb 100644 --- a/source/write/toolbar.py +++ b/source/write/oolbar.py @@ -42,9 +42,14 @@ class EditToolbar(gtk.Toolbar): def __init__(self, pc, toolbar_box): gtk.Toolbar.__init__(self) - self._abiword_canvas = pc.abiword_canvas - + 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' copy = CopyButton() copy.props.accelerator = 'C' copy.connect('clicked', lambda button: pc.abiword_canvas.copy()) @@ -102,13 +107,13 @@ class EditToolbar(gtk.Toolbar): self._search_entry.add_clear_button() self._add_widget(self._search_entry, expand=True) - self._findprev = ToolButton('go-previous-paired') + self._findprev = ToolButton(self.previousbutton) self._findprev.set_tooltip(_('Find previous')) self.insert(self._findprev, -1) self._findprev.show() self._findprev.connect('clicked', self._findprev_cb) - self._findnext = ToolButton('go-next-paired') + self._findnext = ToolButton(self.nextbutton) self._findnext.set_tooltip(_('Find next')) self.insert(self._findnext, -1) self._findnext.show() -- 1.7.0.4