From 78bd5a02568d9689b45cbdaba5115afecaddbbf4 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Wed, 19 Jun 2013 18:02:14 +0000 Subject: [PATCH] bug 6812: pedigree view is broken in RTL locales Make the table widget in the view forced LTR. Everything else (person box widget and the top window) is LTR or RTL, depending on the locale. Unfortunately, due to current broken pango logic, for RTL locales the person boxes will still be left-aligned :-( svn: r22521 --- src/plugins/view/pedigreeview.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/view/pedigreeview.py b/src/plugins/view/pedigreeview.py index 076e8ba1b..483797787 100644 --- a/src/plugins/view/pedigreeview.py +++ b/src/plugins/view/pedigreeview.py @@ -771,6 +771,9 @@ class PedigreeView(NavigationView): self.scrolledwindow.add_with_viewport(event_box) self.table = gtk.Table(1, 1, False) + # force LTR layout of the tree, even though the text might be RTL! + # this way the horizontal scroll preferences will be correct always + self.table.set_direction(gtk.TEXT_DIR_LTR) event_box.add(self.table) event_box.get_parent().set_shadow_type(gtk.SHADOW_NONE) self.table.set_row_spacings(1) @@ -1275,6 +1278,10 @@ class PedigreeView(NavigationView): elif self.tree_direction == 3: child_arrow = gtk.ARROW_RIGHT parent_arrow = gtk.ARROW_LEFT + # GTK will reverse the icons for RTL locales, but we force LTR layout of the table, + # so reverse the arrows back... + if self.tree_direction in [2,3] and self.scrolledwindow.get_direction() == gtk.TEXT_DIR_RTL: + child_arrow, parent_arrow = parent_arrow, child_arrow button = gtk.Button() button.add(gtk.Arrow(child_arrow, gtk.SHADOW_IN))