Commit 7532ffc2 authored by Robin Stocker's avatar Robin Stocker Committed by John Stowers

Show text in tooltip when label is ellipsized

This is the case for the long texts in the "Typing" section.
parent 9d8d669e
......@@ -43,6 +43,14 @@ def build_label_beside_widget(txt, *widget, **kwargs):
return image
def show_tooltip_when_ellipsized(label, x, y, keyboard_mode, tooltip):
layout = label.get_layout()
if layout.is_ellipsized():
return True
return False
if kwargs.get("hbox"):
hbox = kwargs.get("hbox")
......@@ -52,6 +60,8 @@ def build_label_beside_widget(txt, *widget, **kwargs):
lbl = Gtk.Label(txt)
lbl.props.ellipsize = Pango.EllipsizeMode.END
lbl.props.xalign = 0.0
lbl.connect("query-tooltip", show_tooltip_when_ellipsized)
hbox.pack_start(lbl, True, True, 0)
if kwargs.get("info"):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment