diff --git a/ks_includes/KlippyGtk.py b/ks_includes/KlippyGtk.py index eb2a3a9c..71dcc45a 100644 --- a/ks_includes/KlippyGtk.py +++ b/ks_includes/KlippyGtk.py @@ -119,7 +119,7 @@ class KlippyGtk: return b def ButtonImage(self, image_name, label=None, style=None, width_scale=1, height_scale=1, - position=Gtk.PositionType.TOP): + position=Gtk.PositionType.TOP, word_wrap=True): filename = "%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name)) pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale( filename, @@ -139,13 +139,14 @@ class KlippyGtk: b.set_always_show_image(True) b.props.relief = Gtk.ReliefStyle.NONE - #try: - # # Get the label object - # child = b.get_children()[0].get_children()[0].get_children()[1] - # child.set_line_wrap(True) - # child.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) - #except: - # pass + if word_wrap is True: + try: + # Get the label object + child = b.get_children()[0].get_children()[0].get_children()[1] + child.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) + child.set_line_wrap(True) + except: + pass if style != None: b.get_style_context().add_class(style) diff --git a/panels/bed_mesh.py b/panels/bed_mesh.py index a821364c..7f5bd7f7 100644 --- a/panels/bed_mesh.py +++ b/panels/bed_mesh.py @@ -31,7 +31,7 @@ class BedMeshPanel(ScreenPanel): addprofile = self._gtk.ButtonImage("increase"," %s" % _("Add bed mesh profile"), - "color1", .5, .5, Gtk.PositionType.LEFT) + "color1", .5, .5, Gtk.PositionType.LEFT, False) addprofile.connect("clicked", self.show_create_profile) addprofile.set_size_request(60,0) addprofile.set_hexpand(False)