fix(bar): proper center modules

This commit is contained in:
Alexis 2018-08-16 18:11:16 +02:00
parent 0371271465
commit 0603b99714
1 changed files with 6 additions and 7 deletions

View File

@ -160,12 +160,11 @@ auto waybar::Bar::setupWidgets() -> void
auto &center = *Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 0)); auto &center = *Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 0));
auto &right = *Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 0)); auto &right = *Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 0));
auto &box1 = *Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 0)); auto &box = *Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 0));
window.add(box1); window.add(box);
box1.set_homogeneous(true); box.pack_start(left, true, true);
box1.pack_start(left, true, true); box.set_center_widget(center);
box1.pack_start(center, false, false); box.pack_end(right, true, true);
box1.pack_end(right, true, true);
Factory factory(*this, config_); Factory factory(*this, config_);
@ -181,7 +180,7 @@ auto waybar::Bar::setupWidgets() -> void
for (const auto &name : config_["modules-center"]) { for (const auto &name : config_["modules-center"]) {
auto module = factory.makeModule(name.asString()); auto module = factory.makeModule(name.asString());
if (module != nullptr) { if (module != nullptr) {
center.pack_start(*module, true, false, 10); center.pack_start(*module, true, false, 0);
} }
} }
} }