css: simplify graph_labels

This commit is contained in:
alfrix
2023-08-14 13:54:21 -03:00
parent 06b2246db1
commit fb0d0bb909
3 changed files with 9 additions and 31 deletions

View File

@@ -60,11 +60,9 @@ class Panel(MenuPanel):
self.labels['da'].set_showing(device, visible)
if visible:
count += 1
self.devices[device]['name'].get_style_context().add_class(self.devices[device]['class'])
self.devices[device]['name'].get_style_context().remove_class("graph_label_hidden")
self.devices[device]['name'].get_style_context().add_class("graph_label")
else:
self.devices[device]['name'].get_style_context().add_class("graph_label_hidden")
self.devices[device]['name'].get_style_context().remove_class(self.devices[device]['class'])
self.devices[device]['name'].get_style_context().remove_class("graph_label")
if count > 0:
if self.labels['da'] not in self.left_panel:
self.left_panel.add(self.labels['da'])
@@ -148,11 +146,10 @@ class Panel(MenuPanel):
name = self._gtk.Button(image, self.prettify(devname), None, self.bts, Gtk.PositionType.LEFT, 1)
name.connect("clicked", self.toggle_visibility, device)
name.set_alignment(0, .5)
name.get_style_context().add_class(class_name)
visible = self._config.get_config().getboolean(f"graph {self._screen.connected_printer}", device, fallback=True)
if visible:
name.get_style_context().add_class(class_name)
else:
name.get_style_context().add_class("graph_label_hidden")
name.get_style_context().add_class("graph_label")
self.labels['da'].set_showing(device, visible)
temp = self._gtk.Button(label="", lines=1)