From df64db09523f7914516154ca9743d21e74862048 Mon Sep 17 00:00:00 2001 From: Hue Date: Thu, 12 Nov 2026 12:19:40 +0100 Subject: [PATCH 1/2] =?UTF-8?q?panel=C2=A0:=20remove=20special-casing=20of?= =?UTF-8?q?=20window-list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/panel/panel.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/panel/panel.cpp b/src/panel/panel.cpp index f85d09ca..780c7f1a 100644 --- a/src/panel/panel.cpp +++ b/src/panel/panel.cpp @@ -358,16 +358,6 @@ class WayfirePanel::impl auto widgets = tokenize(list); for (auto widget_name : widgets) { - if (widget_name == "window-list") - { - bool vertical = - (panel_position.value() == PANEL_POSITION_LEFT) || - (panel_position.value() == PANEL_POSITION_RIGHT); - - box.set_hexpand(!vertical); - box.set_vexpand(vertical); - } - auto widget = widget_from_name(widget_name); if (!widget) { @@ -381,26 +371,6 @@ class WayfirePanel::impl } } - void update_window_list_expand() - { - auto has_window_list = [this] (const std::string& list) - { - for (const auto& widget : tokenize(list)) - { - if (widget == "window-list") - { - return true; - } - } - - return false; - }; - - left_box.set_hexpand(has_window_list(left_widgets_opt.value())); - right_box.set_hexpand(has_window_list(right_widgets_opt.value())); - center_box.set_hexpand(has_window_list(center_widgets_opt.value())); - } - WfOption left_widgets_opt{"panel/widgets_left"}; WfOption right_widgets_opt{"panel/widgets_right"}; WfOption center_widgets_opt{"panel/widgets_center"}; @@ -424,7 +394,6 @@ class WayfirePanel::impl void handle_config_reload() { update_orientation(); - update_window_list_expand(); for (auto& w : left_widgets) { From 57ac7e12f490145d195c559f3126ef92b2b47440 Mon Sep 17 00:00:00 2001 From: Hue Date: Thu, 12 Nov 2026 12:20:08 +0100 Subject: [PATCH 2/2] =?UTF-8?q?panel=C2=A0:=20fix=20up=20alignements=20and?= =?UTF-8?q?=20expands=20for=20consistent=20layouts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/panel/panel.cpp | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/panel/panel.cpp b/src/panel/panel.cpp index 780c7f1a..da2af1d4 100644 --- a/src/panel/panel.cpp +++ b/src/panel/panel.cpp @@ -96,55 +96,52 @@ class WayfirePanel::impl auto orientation = is_horizontal ? Gtk::Orientation::HORIZONTAL : Gtk::Orientation::VERTICAL; set_boxes_orientation(orientation); - if (center) + if (is_horizontal) + { + left_box.set_valign(Gtk::Align::FILL); + right_box.set_valign(Gtk::Align::FILL); + center_box.set_valign(Gtk::Align::FILL); + center_box.set_halign(Gtk::Align::CENTER); + } else { - left_box.set_expand(true); - right_box.set_expand(true); + left_box.set_halign(Gtk::Align::FILL); + right_box.set_halign(Gtk::Align::FILL); + center_box.set_halign(Gtk::Align::FILL); + center_box.set_valign(Gtk::Align::CENTER); + } + if (center) + { int lmin, lnat, lminb, lnatb, rmin, rnat, rminb, rnatb, mmin, mnat, mminb, mnatb; left_box.measure(orientation, -1, lmin, lnat, lminb, lnatb); right_box.measure(orientation, -1, rmin, rnat, rminb, rnatb); center_box.measure(orientation, -1, mmin, mnat, mminb, mnatb); - center_box.set_halign(Gtk::Align::CENTER); - center_box.set_valign(Gtk::Align::CENTER); - if (is_horizontal) { content_box.set_size_request((std::max(lnat, rnat) * 2) + mnat, -1); left_box.set_halign(Gtk::Align::END); right_box.set_halign(Gtk::Align::START); - left_box.set_valign(Gtk::Align::FILL); - right_box.set_valign(Gtk::Align::FILL); } else { content_box.set_size_request(-1, (std::max(lnat, rnat) * 2) + mnat); - left_box.set_halign(Gtk::Align::FILL); - right_box.set_halign(Gtk::Align::FILL); left_box.set_valign(Gtk::Align::END); right_box.set_valign(Gtk::Align::START); } } else { - left_box.set_expand(false); - right_box.set_expand(false); - content_box.set_size_request(-1, -1); if (is_horizontal) { left_box.set_halign(Gtk::Align::START); right_box.set_halign(Gtk::Align::END); - left_box.set_valign(Gtk::Align::FILL); - right_box.set_valign(Gtk::Align::FILL); } else { left_box.set_valign(Gtk::Align::START); right_box.set_valign(Gtk::Align::END); - left_box.set_halign(Gtk::Align::FILL); - right_box.set_halign(Gtk::Align::FILL); } } } @@ -175,9 +172,6 @@ class WayfirePanel::impl content_box.set_end_widget(right_box); - content_box.set_hexpand(true); - content_box.set_vexpand(true); - window->set_child(content_box); }