forked from CreatBot/CreatBotKlipperScreen
gtk: do not try to ellipsize if the label is None
This commit is contained in:
@@ -173,6 +173,7 @@ class KlippyGtk:
|
|||||||
b.set_image_position(position)
|
b.set_image_position(position)
|
||||||
b.set_always_show_image(True)
|
b.set_always_show_image(True)
|
||||||
|
|
||||||
|
if label is not None:
|
||||||
try:
|
try:
|
||||||
# Get the label object
|
# Get the label object
|
||||||
child = b.get_children()[0].get_children()[0].get_children()[1]
|
child = b.get_children()[0].get_children()[0].get_children()[1]
|
||||||
@@ -182,7 +183,7 @@ class KlippyGtk:
|
|||||||
child.set_ellipsize(Pango.EllipsizeMode.END)
|
child.set_ellipsize(Pango.EllipsizeMode.END)
|
||||||
child.set_lines(lines)
|
child.set_lines(lines)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.debug(f"Unable to wrap and ellipsize label: {e}")
|
logging.debug(f"Unable to wrap and ellipsize label: {image_name} {label} {e}")
|
||||||
|
|
||||||
if style is not None:
|
if style is not None:
|
||||||
b.get_style_context().add_class(style)
|
b.get_style_context().add_class(style)
|
||||||
|
Reference in New Issue
Block a user