Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ty3uK
Copy link

@Ty3uK Ty3uK commented Aug 4, 2024

Not an experienced C++ developer at all, will be glad to hear any advice 🙏
swappy-20240805_013408
Generally, it's like sway/workspaces behavior.

const bool show_only_viable = config_["show-only-viable"].asBool();
if (show_only_viable) {
if (clients > 0 || state & (TAG_ACTIVE | TAG_URGENT)) {
button.show();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if blindly calling show/hide is OK, was thinking about button.is_visible() checks.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show and hide are deprecated since 4.10.

Use gtk_widget_set_visible() instead:

    if (clients || state & (TAG_ACTIVE | TAG_URGENT)) {
      button.set_visible(true);
    } else {
      button.set_visible(false);
    }

@Alexays Alexays force-pushed the master branch 2 times, most recently from d623a89 to a4d31ab Compare September 13, 2024 07:40
@bitterhalt
Copy link

Would it be possible to have similar feature in River tags?

const bool show_only_viable = config_["show-only-viable"].asBool();
if (show_only_viable) {
if (clients > 0 || state & (TAG_ACTIVE | TAG_URGENT)) {
button.show();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show and hide are deprecated since 4.10.

Use gtk_widget_set_visible() instead:

    if (clients || state & (TAG_ACTIVE | TAG_URGENT)) {
      button.set_visible(true);
    } else {
      button.set_visible(false);
    }


const bool show_only_viable = config_["show-only-viable"].asBool();
if (show_only_viable) {
if (clients > 0 || state & (TAG_ACTIVE | TAG_URGENT)) {
Copy link

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)) {

@thetwistedlogic
Copy link

Would it be possible to have similar feature in River tags?

Just implemented this over here: #3823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants