KlippyGtk: Add word wrapping to buttons
This commit is contained in:
parent
c2dc0fdb46
commit
f5a2d97842
@ -3,7 +3,7 @@ import gi
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib
|
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib, Pango
|
||||||
import os
|
import os
|
||||||
klipperscreendir = os.getcwd()
|
klipperscreendir = os.getcwd()
|
||||||
|
|
||||||
@ -129,6 +129,14 @@ class KlippyGtk:
|
|||||||
b.set_always_show_image(True)
|
b.set_always_show_image(True)
|
||||||
b.props.relief = Gtk.ReliefStyle.NONE
|
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 style != None:
|
if style != None:
|
||||||
b.get_style_context().add_class(style)
|
b.get_style_context().add_class(style)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user