From 4d2ae8df7481ef58abb696f11fa10a74cbcb9d90 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Wed, 21 Aug 2013 07:32:23 +0000 Subject: [PATCH] 6871: workaround gtk RTL bug in MultiTreeView optimizing cleanup svn: r22890 --- gramps/gui/widgets/multitreeview.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gramps/gui/widgets/multitreeview.py b/gramps/gui/widgets/multitreeview.py index bdd40b76c..a7a2644c3 100644 --- a/gramps/gui/widgets/multitreeview.py +++ b/gramps/gui/widgets/multitreeview.py @@ -45,18 +45,18 @@ class MultiTreeView(Gtk.TreeView): self.connect('key_press_event', self.key_press_event) self.defer_select = False - __grid_lines_remove_vertical = { - Gtk.TreeViewGridLines.NONE : Gtk.TreeViewGridLines.NONE, - Gtk.TreeViewGridLines.HORIZONTAL : Gtk.TreeViewGridLines.HORIZONTAL, - Gtk.TreeViewGridLines.VERTICAL : Gtk.TreeViewGridLines.NONE, - Gtk.TreeViewGridLines.BOTH : Gtk.TreeViewGridLines.HORIZONTAL - } - def set_grid_lines(self, grid_lines): - if (self.get_direction() == Gtk.TextDirection.RTL and - (Gtk.get_major_version(), Gtk.get_minor_version()) < (3, 8)): - # Work around a gtk RTL bug, see #6871 - grid_lines = MultiTreeView.__grid_lines_remove_vertical[grid_lines] - super(MultiTreeView, self).set_grid_lines(grid_lines) + if (Gtk.get_major_version(), Gtk.get_minor_version()) < (3, 8): + __grid_lines_remove_vertical = { + Gtk.TreeViewGridLines.NONE : Gtk.TreeViewGridLines.NONE, + Gtk.TreeViewGridLines.HORIZONTAL : Gtk.TreeViewGridLines.HORIZONTAL, + Gtk.TreeViewGridLines.VERTICAL : Gtk.TreeViewGridLines.NONE, + Gtk.TreeViewGridLines.BOTH : Gtk.TreeViewGridLines.HORIZONTAL + } + def set_grid_lines(self, grid_lines): + if self.get_direction() == Gtk.TextDirection.RTL: + # Work around a gtk RTL bug, see #6871 + grid_lines = MultiTreeView.__grid_lines_remove_vertical[grid_lines] + super(MultiTreeView, self).set_grid_lines(grid_lines) def key_press_event(self, widget, event): if event.type == Gdk.EventType.KEY_PRESS: