-
-
Notifications
You must be signed in to change notification settings - Fork 728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dwl/tags option to show only active tags #3504
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,6 +198,15 @@ void Tags::handle_view_tags(uint32_t tag, uint32_t state, uint32_t clients, uint | |
} else { | ||
button.get_style_context()->remove_class("urgent"); | ||
} | ||
|
||
const bool show_only_viable = config_["show-only-viable"].asBool(); | ||
if (show_only_viable) { | ||
if (clients > 0 || state & (TAG_ACTIVE | TAG_URGENT)) { | ||
button.show(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if blindly calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Use gtk_widget_set_visible() instead: if (clients || state & (TAG_ACTIVE | TAG_URGENT)) {
button.set_visible(true);
} else {
button.set_visible(false);
} |
||
} else { | ||
button.hide(); | ||
} | ||
} | ||
} | ||
|
||
} /* namespace waybar::modules::dwl */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just use
clients
in the condition without> 0
:if (clients || state & (TAG_ACTIVE | TAG_URGENT)) {