Add tooltip to links in styled text editor

Fixes #10179.
This commit is contained in:
Nick Hall 2018-02-07 16:32:18 +00:00
parent 0445004e7d
commit be11466b35

View File

@ -62,7 +62,7 @@ from ..spell import Spell
from ..display import display_url
from ..utils import SystemFonts, get_primary_mask, get_link_color
from gramps.gen.config import config
from gramps.gen.constfunc import has_display
from gramps.gen.constfunc import has_display, mac
from ..actiongroup import ActionGroup
#-------------------------------------------------------------------------
@ -315,7 +315,9 @@ class StyledTextEditor(Gtk.TextView):
if url.startswith("gramps://"):
obj_class, prop, value = url[9:].split("/")
display = simple_access.display(obj_class, prop, value) or url
return display
return display + ((_("\nCommand-Click to follow link") if mac() else
_("\nCtrl-Click to follow link"))
if self.get_editable() else '')
def on_button_release_event(self, widget, event):
"""