fix switch sizes after frames removal
This commit is contained in:
parent
ea4efa1f61
commit
75c8681781
@ -30,32 +30,38 @@ class ConsolePanel(ScreenPanel):
|
|||||||
self.hidetemps = True
|
self.hidetemps = True
|
||||||
|
|
||||||
o1_lbl = Gtk.Label(_("Auto-scroll"))
|
o1_lbl = Gtk.Label(_("Auto-scroll"))
|
||||||
o1_lbl.set_halign(Gtk.Align.END)
|
|
||||||
o1_switch = Gtk.Switch()
|
o1_switch = Gtk.Switch()
|
||||||
o1_switch.set_property("width-request", round(self._gtk.get_font_size() * 5))
|
|
||||||
o1_switch.set_property("height-request", round(self._gtk.get_font_size() * 2.5))
|
|
||||||
o1_switch.set_active(self.autoscroll)
|
o1_switch.set_active(self.autoscroll)
|
||||||
o1_switch.connect("notify::active", self.set_autoscroll)
|
o1_switch.connect("notify::active", self.set_autoscroll)
|
||||||
|
|
||||||
o2_lbl = Gtk.Label(_("Hide temp."))
|
o2_lbl = Gtk.Label(_("Hide temp."))
|
||||||
o2_lbl.set_halign(Gtk.Align.END)
|
|
||||||
o2_switch = Gtk.Switch()
|
o2_switch = Gtk.Switch()
|
||||||
o2_switch.set_property("width-request", round(self._gtk.get_font_size() * 5))
|
|
||||||
o2_switch.set_property("height-request", round(self._gtk.get_font_size() * 2.5))
|
|
||||||
o2_switch.set_active(self.hidetemps)
|
o2_switch.set_active(self.hidetemps)
|
||||||
o2_switch.connect("notify::active", self.hide_temps)
|
o2_switch.connect("notify::active", self.hide_temps)
|
||||||
|
|
||||||
|
if self._screen.vertical_mode:
|
||||||
|
o1_lbl.set_halign(Gtk.Align.CENTER)
|
||||||
|
o2_lbl.set_halign(Gtk.Align.CENTER)
|
||||||
|
else:
|
||||||
|
o1_lbl.set_halign(Gtk.Align.END)
|
||||||
|
o2_lbl.set_halign(Gtk.Align.END)
|
||||||
o3_button = self._gtk.Button("refresh", _('Clear') + " ", None, self.bts, Gtk.PositionType.RIGHT, 1)
|
o3_button = self._gtk.Button("refresh", _('Clear') + " ", None, self.bts, Gtk.PositionType.RIGHT, 1)
|
||||||
o3_button.connect("clicked", self.clear)
|
o3_button.connect("clicked", self.clear)
|
||||||
|
|
||||||
options = Gtk.Box()
|
options = Gtk.Grid()
|
||||||
options.set_hexpand(True)
|
|
||||||
options.set_vexpand(False)
|
options.set_vexpand(False)
|
||||||
options.add(o1_lbl)
|
if self._screen.vertical_mode:
|
||||||
options.pack_start(o1_switch, False, False, 5)
|
options.attach(o1_lbl, 0, 0, 1, 1)
|
||||||
options.add(o2_lbl)
|
options.attach(o1_switch, 0, 1, 1, 1)
|
||||||
options.pack_start(o2_switch, False, False, 5)
|
options.attach(o2_lbl, 1, 0, 1, 1)
|
||||||
options.add(o3_button)
|
options.attach(o2_switch, 1, 1, 1, 1)
|
||||||
|
options.attach(o3_button, 3, 0, 1, 2)
|
||||||
|
else:
|
||||||
|
options.attach(o1_lbl, 0, 0, 1, 1)
|
||||||
|
options.attach(o1_switch, 1, 0, 1, 1)
|
||||||
|
options.attach(o2_lbl, 2, 0, 1, 1)
|
||||||
|
options.attach(o2_switch, 3, 0, 1, 1)
|
||||||
|
options.attach(o3_button, 4, 0, 1, 1)
|
||||||
|
|
||||||
sw = Gtk.ScrolledWindow()
|
sw = Gtk.ScrolledWindow()
|
||||||
sw.set_hexpand(True)
|
sw.set_hexpand(True)
|
||||||
|
@ -78,18 +78,11 @@ class SettingsPanel(ScreenPanel):
|
|||||||
|
|
||||||
dev.add(labels)
|
dev.add(labels)
|
||||||
if option['type'] == "binary":
|
if option['type'] == "binary":
|
||||||
box = Gtk.Box()
|
|
||||||
box.set_vexpand(False)
|
|
||||||
switch = Gtk.Switch()
|
switch = Gtk.Switch()
|
||||||
switch.set_hexpand(False)
|
|
||||||
switch.set_vexpand(False)
|
|
||||||
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name))
|
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name))
|
||||||
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name,
|
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name,
|
||||||
option['callback'] if "callback" in option else None)
|
option['callback'] if "callback" in option else None)
|
||||||
switch.set_property("width-request", round(self._gtk.get_font_size() * 7))
|
dev.add(switch)
|
||||||
switch.set_property("height-request", round(self._gtk.get_font_size() * 3.5))
|
|
||||||
box.add(switch)
|
|
||||||
dev.add(box)
|
|
||||||
elif option['type'] == "dropdown":
|
elif option['type'] == "dropdown":
|
||||||
dropdown = Gtk.ComboBoxText()
|
dropdown = Gtk.ComboBoxText()
|
||||||
for i, opt in enumerate(option['options']):
|
for i, opt in enumerate(option['options']):
|
||||||
|
@ -91,6 +91,9 @@ combobox arrow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
margin: 0.75em;
|
||||||
|
min-width: 6em;
|
||||||
|
min-height: 3em;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 3em;
|
border-radius: 3em;
|
||||||
}
|
}
|
||||||
@ -483,6 +486,11 @@ popover button {
|
|||||||
.filament_sensor {
|
.filament_sensor {
|
||||||
border-radius: 3em;
|
border-radius: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filament_sensor switch {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.filament_sensor_detected {
|
.filament_sensor_detected {
|
||||||
background-color: darkgreen;
|
background-color: darkgreen;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user