refactor(dialogs): make button padding smaller and hexpand prompt buttons
This commit is contained in:
parent
599753859c
commit
1f2bd4cf72
@ -16,7 +16,6 @@ class Prompt:
|
||||
self.prompt = None
|
||||
self.scroll_box = Gtk.Box(
|
||||
orientation=Gtk.Orientation.VERTICAL,
|
||||
halign=Gtk.Align.CENTER
|
||||
)
|
||||
self.groups = []
|
||||
|
||||
@ -68,9 +67,6 @@ class Prompt:
|
||||
Gtk.FlowBox(
|
||||
selection_mode=Gtk.SelectionMode.NONE,
|
||||
orientation=Gtk.Orientation.HORIZONTAL,
|
||||
halign=Gtk.Align.CENTER,
|
||||
min_children_per_line=4,
|
||||
max_children_per_line=4,
|
||||
)
|
||||
)
|
||||
elif data == 'prompt_button_group_end':
|
||||
@ -84,6 +80,10 @@ class Prompt:
|
||||
button.connect("clicked", self.screen._send_action, "printer.gcode.script", {'script': gcode})
|
||||
if self.groups:
|
||||
self.groups[-1].add(button)
|
||||
# Workaround to expand the buttons horizontally
|
||||
max_childs = len(self.groups[-1].get_children())
|
||||
self.groups[-1].set_max_children_per_line(min(4, max_childs))
|
||||
self.groups[-1].set_min_children_per_line(min(4, max_childs))
|
||||
else:
|
||||
self.scroll_box.add(button)
|
||||
|
||||
|
@ -318,9 +318,9 @@ class Panel(ScreenPanel):
|
||||
action = _("Print") if self._printer.extrudercount > 0 else _("Start")
|
||||
|
||||
buttons = [
|
||||
{"name": _("Delete"), "response": Gtk.ResponseType.REJECT, "style": 'dialog-warning'},
|
||||
{"name": action, "response": Gtk.ResponseType.OK},
|
||||
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL, "style": 'dialog-error'}
|
||||
{"name": _("Delete"), "response": Gtk.ResponseType.REJECT, "style": 'dialog-error'},
|
||||
{"name": action, "response": Gtk.ResponseType.OK, "style": 'dialog-primary'},
|
||||
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL, "style": 'dialog-secondary'}
|
||||
]
|
||||
|
||||
label = Gtk.Label(hexpand=True, vexpand=True, wrap=True, wrap_mode=Pango.WrapMode.WORD_CHAR)
|
||||
|
@ -295,7 +295,7 @@ trough {
|
||||
}
|
||||
|
||||
.dialog button {
|
||||
padding: 1.5em;
|
||||
padding: 1.5em 0.2em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ textview .time {
|
||||
}
|
||||
|
||||
.dialog-warning {
|
||||
border-bottom-color: @solarized-yellow;
|
||||
border-bottom-color: @solarized-orange;
|
||||
}
|
||||
|
||||
.dialog-info {
|
||||
@ -260,7 +260,7 @@ textview .time {
|
||||
}
|
||||
|
||||
.dialog-default {
|
||||
border-bottom-color: @solarized-green;
|
||||
border-bottom-color: @solarized-blue;
|
||||
}
|
||||
|
||||
.dialog-secondary {
|
||||
@ -268,5 +268,5 @@ textview .time {
|
||||
}
|
||||
|
||||
.dialog-primary {
|
||||
border-bottom-color: @solarized-orange;
|
||||
border-bottom-color: @solarized-green;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user