Word Wrap (#395)
* Word-wrap dialogs * prevent horizontal scrollbar caused by translators * Fix weird indentation on print name
This commit is contained in:
parent
9449f24b5f
commit
58e0aa74d0
@ -243,16 +243,16 @@ class KlippyGtk:
|
|||||||
dialog.set_transient_for(screen)
|
dialog.set_transient_for(screen)
|
||||||
dialog.set_modal(True)
|
dialog.set_modal(True)
|
||||||
|
|
||||||
for button in buttons:
|
for i, button in enumerate(buttons):
|
||||||
dialog.add_button(button_text=button['name'], response_id=button['response'])
|
dialog.add_button(button_text=button['name'], response_id=button['response'])
|
||||||
|
button = dialog.get_children()[0].get_children()[0].get_children()[0].get_children()[i]
|
||||||
|
button.get_child().set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||||
|
button.get_child().set_line_wrap(True)
|
||||||
|
button.set_size_request((screen.width-30)/3, screen.height/5)
|
||||||
|
|
||||||
dialog.connect("response", callback, *args)
|
dialog.connect("response", callback, *args)
|
||||||
dialog.get_style_context().add_class("dialog")
|
dialog.get_style_context().add_class("dialog")
|
||||||
|
|
||||||
box = Gtk.Box()
|
|
||||||
box.set_size_request(screen.width - 60, 0)
|
|
||||||
box.set_vexpand(True)
|
|
||||||
|
|
||||||
content_area = dialog.get_content_area()
|
content_area = dialog.get_content_area()
|
||||||
content_area.set_margin_start(15)
|
content_area.set_margin_start(15)
|
||||||
content_area.set_margin_end(15)
|
content_area.set_margin_end(15)
|
||||||
|
@ -195,7 +195,7 @@ class PrintPanel(ScreenPanel):
|
|||||||
name.set_hexpand(True)
|
name.set_hexpand(True)
|
||||||
name.set_halign(Gtk.Align.START)
|
name.set_halign(Gtk.Align.START)
|
||||||
name.set_line_wrap(True)
|
name.set_line_wrap(True)
|
||||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
name.set_line_wrap_mode(Pango.WrapMode.CHAR)
|
||||||
|
|
||||||
info = Gtk.Label()
|
info = Gtk.Label()
|
||||||
info.set_halign(Gtk.Align.START)
|
info.set_halign(Gtk.Align.START)
|
||||||
@ -357,7 +357,7 @@ class PrintPanel(ScreenPanel):
|
|||||||
if fileinfo is None:
|
if fileinfo is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
return "<small>%s: <b>%s</b> - %s: <b>%s</b>\n%s: <b>%s</b></small>" % (
|
return "<small>%s: <b>%s</b>\n%s: <b>%s</b>\n%s: <b>%s</b></small>" % (
|
||||||
_("Uploaded"),
|
_("Uploaded"),
|
||||||
datetime.fromtimestamp(fileinfo['modified']).strftime("%Y-%m-%d %H:%M"),
|
datetime.fromtimestamp(fileinfo['modified']).strftime("%Y-%m-%d %H:%M"),
|
||||||
_("Size"),
|
_("Size"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user