Add fixed-center option

Resolves #957
This commit is contained in:
ilkecan
2021-12-28 15:57:10 +03:00
parent 8ec321ddaf
commit 548bd2ab1a
2 changed files with 11 additions and 1 deletions

View File

@ -767,7 +767,11 @@ void waybar::Bar::getModules(const Factory& factory, const std::string& pos, Gtk
auto waybar::Bar::setupWidgets() -> void {
window.add(box_);
box_.pack_start(left_, false, false);
box_.set_center_widget(center_);
if (config["fixed-center"].isBool() ? config["fixed-center"].asBool() : true) {
box_.set_center_widget(center_);
} else {
box_.pack_start(center_, true, false);
}
box_.pack_end(right_, false, false);
// Convert to button code for every module that is used.