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
This commit is contained in:
Vassilii Khachaturov 2013-06-19 18:02:14 +00:00
parent 59c820902e
commit 78bd5a0256

View File

@ -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))