Merge pull request #3459 from khaneliman/bar-visible

This commit is contained in:
Alexis Rouillard 2024-07-20 18:16:06 +02:00 committed by GitHub
commit cb8fc1c10d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -66,7 +66,7 @@ class Bar {
~Bar(); ~Bar();
void setMode(const std::string &mode); void setMode(const std::string &mode);
void setVisible(bool visible); void setVisible(bool value);
void toggle(); void toggle();
void handleSignal(int); void handleSignal(int);

View File

@ -404,7 +404,8 @@ void waybar::Bar::onMap(GdkEventAny* /*unused*/) {
setPassThrough(passthrough_); setPassThrough(passthrough_);
} }
void waybar::Bar::setVisible(bool visible) { void waybar::Bar::setVisible(bool value) {
visible = value;
if (auto mode = config.get("mode", {}); mode.isString()) { if (auto mode = config.get("mode", {}); mode.isString()) {
setMode(visible ? config["mode"].asString() : MODE_INVISIBLE); setMode(visible ? config["mode"].asString() : MODE_INVISIBLE);
} else { } else {