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

on-click and hover doesn't work on the group itself #3174

Closed
itcreeperboy opened this issue Apr 26, 2024 · 4 comments
Closed

on-click and hover doesn't work on the group itself #3174

itcreeperboy opened this issue Apr 26, 2024 · 4 comments

Comments

@itcreeperboy
Copy link

i have a group of modules and i wanted clicking any part of the group to send me to missioncenter

"group/hardware": {
        "on-click": "missioncenter",
        "orientation": "horizontal",
        "modules": [
            "disk",
            "memory",
            "cpu",
            "custom/gpu"
        ]
    }

i tried just doing this but it didn't trigger when i clicked.

not a big deal because i can just do on-click on the individual modules

but then i tried to add a border to the group on hover:

#hardware:hover {
  box-shadow: inset 0 0 0 4px #cba6f7;
}

and it doesn't trigger when i hover over it, unlike any normal module or the seperate modules in the group when i do this:

#hardware *:hover {
  box-shadow: inset 0 0 0 4px #cba6f7;
} 

and i havn't found a way to trigger adding a border to the whole group from hovering on one of it's modules

idk if this is intended or not, if it is, is there some other way to get the same result? sorry if i'm being stupid i'm css noob lol

here is config and style.css

@ordy
Copy link
Contributor

ordy commented Apr 26, 2024

Your selector for that group should be #hardware-group not just #hardware

However, the group should be a GtkBox and I don't know if they support box-shadow, while simple borders should work

#hardware-group: { border: 4px solid #cba6f7 } 

That would obviously add an extra 4px padding to your group (probably what you are trying to avoid using the box-shadow).

Now for the hover part, I couldn't make it work on the group selector, but note that hover for custom modules has been implemented just a week ago in #3145 so there is a chance that the group module has been left out.

#hardware-group label:hover works but that's just on the label part, not over the modules.

if you set #hardware-group box you have the border on the modules, but again, no hover support straight on box:hover.

If you need help targeting your css classes, run warbar with the GTK debug too:

GTK_DEBUG=interactive waybar then select CSS nodes in the menu that will give your id's and extra classes to work with.

Edit: forgot about the click event.

I don't think the group even supports click events (which makes sense tbh), so you would probably have to set the same event on each individual modules inside your group.

@haug1
Copy link
Contributor

haug1 commented Apr 27, 2024

I don't see a clear and obvious reason why hover should not be working with groups.
After a quick glance a the code, I have a theory it may be a similar problem to the one I patched: https://github.com/Alexays/Waybar/blob/master/src/group.cpp#L98. (But haven't tested anything and maybe it's not safe to just change the behavior.)

@haug1
Copy link
Contributor

haug1 commented May 3, 2024

Forgot to update, but I've noticed my previous comment was wrong. Group was not using the GTK component of AModule, it had its own seperate override, so this is why. I made a PR, so maybe we will have this on whole groups as well soon.

Alexays pushed a commit that referenced this issue May 6, 2024
* feat(#3174): hover for whole group

* fix: target eventbox for class also

* fix: actually no reason to add handler, just override AModule

* fix: actually remove existing handler as well

drawer functionality still works from my testing. anything else to think
abotu?

* revert: keep id and class on original box

* refactor: clang-format group.hpp

* dev: try stop workflow
@haug1
Copy link
Contributor

haug1 commented May 6, 2024

This issue is resolved as of latest release (0.10.3). Please close (or prove me wrong!), anyone who can.

@Alexays Alexays closed this as completed May 7, 2024
zjeffer pushed a commit to zjeffer/Waybar that referenced this issue May 7, 2024
* feat(Alexays#3174): hover for whole group

* fix: target eventbox for class also

* fix: actually no reason to add handler, just override AModule

* fix: actually remove existing handler as well

drawer functionality still works from my testing. anything else to think
abotu?

* revert: keep id and class on original box

* refactor: clang-format group.hpp

* dev: try stop workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants