additional refinements

svn: r10154
This commit is contained in:
Doug Blank 2008-03-02 06:10:20 +00:00
parent e96b543384
commit 6b8d041c94
2 changed files with 11 additions and 9 deletions

View File

@ -597,18 +597,19 @@ class GuiGramplet:
retval += text[i]
r += 1
i += 1
self.set_text(retval)
offset = len(self.get_text())
self.append_text(retval)
for (a,b) in markup_pos["B"]:
start = self.buffer.get_iter_at_offset(a)
stop = self.buffer.get_iter_at_offset(b)
start = self.buffer.get_iter_at_offset(a + offset)
stop = self.buffer.get_iter_at_offset(b + offset)
self.buffer.apply_tag_by_name("bold", start, stop)
for (a,b) in markup_pos["I"]:
start = self.buffer.get_iter_at_offset(a)
stop = self.buffer.get_iter_at_offset(b)
start = self.buffer.get_iter_at_offset(a + offset)
stop = self.buffer.get_iter_at_offset(b + offset)
self.buffer.apply_tag_by_name("italic", start, stop)
for (a,b) in markup_pos["U"]:
start = self.buffer.get_iter_at_offset(a)
stop = self.buffer.get_iter_at_offset(b)
start = self.buffer.get_iter_at_offset(a + offset)
stop = self.buffer.get_iter_at_offset(b + offset)
self.buffer.apply_tag_by_name("underline", start, stop)
def set_use_markup(self, value):

View File

@ -448,6 +448,7 @@ class PedigreeGramplet(Gramplet):
self.tooltip = _("Click name to make person active\n") + \
_("Right-click name to edit person")
self.max_generations = 100
self.set_use_markup(True)
def db_changed(self):
"""
@ -507,8 +508,7 @@ class PedigreeGramplet(Gramplet):
self.append_text("\n")
elif what == "a":
self.append_text("o------")
self.link(name_displayer.display_name(person.get_primary_name()),
'Person', person.handle)
self.render_text("<b>%s</b>" % name_displayer.display_name(person.get_primary_name()))
self.append_text("\n")
elif what == "m":
if len(family_list) > 0:
@ -811,6 +811,7 @@ class NewsGramplet(Gramplet):
for match in matches:
text = text.replace("'''%s'''" % match, "<B>%s</B>" % match)
text = "News from <I>www.gramps-project.org</I>:\n\n" + text
self.clear_text()
self.set_use_markup(True)
self.render_text(text)