equal columns by default "modules-center" not empty

This commit is contained in:
piotr
2021-01-31 11:36:18 +01:00
parent d0e04bce19
commit 3b0b2794e6

View File

@@ -210,7 +210,6 @@ def main():
check_key(panel, "output", "") check_key(panel, "output", "")
if panel["output"] in common.outputs or not panel["output"]: if panel["output"] in common.outputs or not panel["output"]:
check_key(panel, "spacing", 6) check_key(panel, "spacing", 6)
check_key(panel, "homogeneous", False)
check_key(panel, "css-name", "") check_key(panel, "css-name", "")
check_key(panel, "padding-horizontal", 0) check_key(panel, "padding-horizontal", 0)
check_key(panel, "padding-vertical", 0) check_key(panel, "padding-vertical", 0)
@@ -250,9 +249,18 @@ def main():
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0) hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0)
vbox.pack_start(hbox, True, True, panel["padding-vertical"]) vbox.pack_start(hbox, True, True, panel["padding-vertical"])
check_key(panel, "modules-left", [])
check_key(panel, "modules-center", [])
check_key(panel, "modules-right", [])
# set equal columns width by default if "modules-center" not empty; this may be overridden in config
if panel["modules-center"]:
check_key(panel, "homogeneous", True)
else:
check_key(panel, "homogeneous", False)
inner_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0) inner_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0)
if panel["homogeneous"]: inner_box.set_homogeneous(panel["homogeneous"])
inner_box.set_homogeneous(True)
hbox.pack_start(inner_box, True, True, panel["padding-horizontal"]) hbox.pack_start(inner_box, True, True, panel["padding-horizontal"])
left_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=panel["spacing"]) left_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=panel["spacing"])
@@ -268,7 +276,7 @@ def main():
int(w / 6), monitor=monitor) int(w / 6), monitor=monitor)
common.controls_list.append(cc) common.controls_list.append(cc)
left_box.pack_start(cc, False, False, 0) left_box.pack_start(cc, False, False, 0)
check_key(panel, "modules-left", [])
instantiate_content(panel, left_box, panel["modules-left"]) instantiate_content(panel, left_box, panel["modules-left"])
center_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=panel["spacing"]) center_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=panel["spacing"])