Uses user-defined mode when toggling visibility rather than resetting to default mode

This commit is contained in:
Daniel Moore 2022-03-12 13:32:08 -07:00
parent 2b3fc3acff
commit f4c6dfcddc
1 changed files with 5 additions and 1 deletions

View File

@ -665,8 +665,12 @@ void waybar::Bar::onMap(GdkEventAny*) {
void waybar::Bar::setVisible(bool value) { void waybar::Bar::setVisible(bool value) {
visible = value; visible = value;
if (auto mode = config.get("mode", {}); mode.isString()) {
setMode(visible ? config["mode"].asString() : MODE_INVISIBLE);
} else {
setMode(visible ? MODE_DEFAULT : MODE_INVISIBLE); setMode(visible ? MODE_DEFAULT : MODE_INVISIBLE);
} }
}
void waybar::Bar::toggle() { setVisible(!visible); } void waybar::Bar::toggle() { setVisible(!visible); }