forked from CreatBot/CreatBotKlipperScreen
gtk: remove newlines to properly wrap lines if needed
this fixes the issue caused by labels with a newlines detected as 1 line even if it has more than one
This commit is contained in:
@@ -164,14 +164,16 @@ class KlippyGtk:
|
||||
return b
|
||||
|
||||
def ButtonImage(self, image_name=None, label=None, style=None, scale=1.38, position=Gtk.PositionType.TOP, lines=2):
|
||||
b = Gtk.Button(label=label)
|
||||
b = Gtk.Button()
|
||||
if label is not None:
|
||||
b.set_label(label.replace("\n", " "))
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
b.set_can_focus(False)
|
||||
if image_name is not None:
|
||||
b.set_image(self.Image(image_name, scale))
|
||||
b.set_image_position(position)
|
||||
b.set_always_show_image(True)
|
||||
b.set_image_position(position)
|
||||
b.set_always_show_image(True)
|
||||
|
||||
if label is not None:
|
||||
try:
|
||||
|
Reference in New Issue
Block a user