From 9c2a24083ba39143803c10f3899822cb1b0e7ab2 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 30 Jun 2006 13:58:19 +0000 Subject: [PATCH] 2006-06-30 Don Allingham * src/GrampsWidgets.py: Add GenderWidget to try to isolate windows font problems svn: r6973 --- gramps2/ChangeLog | 4 ++++ gramps2/src/GrampsWidgets.py | 24 +++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 3e0dbec77..008b95e10 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2006-06-30 Don Allingham + * src/GrampsWidgets.py: Add GenderWidget to try to isolate windows + font problems + 2006-06-28 Don Allingham * src/DataViews/_PedigreeView.py (PedigreeView.rebuild): use gtk.Arrow instead of unicode characters diff --git a/gramps2/src/GrampsWidgets.py b/gramps2/src/GrampsWidgets.py index e53d0b417..f8a880c4a 100644 --- a/gramps2/src/GrampsWidgets.py +++ b/gramps2/src/GrampsWidgets.py @@ -31,6 +31,7 @@ from gettext import gettext as _ #------------------------------------------------------------------------- import gobject import gtk +import pango import AutoComp import DateHandler @@ -52,15 +53,17 @@ class LinkLabel(gtk.EventBox): self.orig_text = cgi.escape(label[0]) self.gender = label[1] text = '%s' % self.orig_text - if label[1]: - text += u' %s' % label[1] self.label = gtk.Label(text) self.label.set_use_markup(True) self.label.set_alignment(0, 0.5) - self.add(self.label) - + hbox = gtk.HBox() + hbox.add(self.label) + if label[1]: + hbox.add(GenderLabel(label[1])) + self.add(hbox) + self.connect('button-press-event', func, handle) self.connect('enter-notify-event', self.enter_text, handle) self.connect('leave-notify-event', self.leave_text, handle) @@ -150,9 +153,6 @@ class EditLabel(gtk.HBox): self.pack_start(gtk.image_new_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_MENU), False) self.set_spacing(4) -# self.tooltip = gtk.Tooltips() -# self.tooltip.set_tip(label, _('Click in the cell to change the value')) -# self.tooltip.enable() self.show_all() class BasicLabel(gtk.Label): @@ -162,6 +162,16 @@ class BasicLabel(gtk.Label): self.set_alignment(0, 0.5) self.show() +class GenderLabel(gtk.Label): + + def __init__(self, text): + gtk.Label.__init__(self, text) + self.set_alignment(0, 0.5) + if os.sys.platform == "win32": + pangoFont = pango.FontDescription('Arial') + self.modify_font(pangoFont) + self.show() + class MarkupLabel(gtk.Label): def __init__(self, text):