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

:hover is not working, only on #workspaces? #282

Closed
AndreasBackx opened this issue Apr 22, 2019 · 25 comments
Closed

:hover is not working, only on #workspaces? #282

AndreasBackx opened this issue Apr 22, 2019 · 25 comments
Labels
question Further information is requested

Comments

@AndreasBackx
Copy link
Contributor

Is it true that adding a hover effect in CSS only works for the sway module for the id workspaces? I can only get it to work for that. I wanted to enable a hover effect when hovering over modules so I know that it is the right one I'm clicking.

Regarding this same problem, the way to have different colors for icons also would not work here because the CSS in GTK probably doesn't override the HTML defined in the modules. #50

"format": "<span color=\"#fff\">{}</span>"

The span element's color would not be able to change on hover or any way at all in CSS. Defining a span inside of the module without a color attribute and trying to change the color of that span inside of there also doesn't work it seems.

@AdrienLemaire
Copy link
Contributor

I'm also interested in toggling bg/fg on hover. Took me a while to realize that it only works on #workspaces ^^

@ghost
Copy link

ghost commented Feb 13, 2020

why is this ? I want to try and toggle to make the bar disappear until mouseover ::(

@lorendias
Copy link

I could specifically use :hover on #custom-xxx:hover elements

Also, :first-child and :last-child would help in instances where buttons are grouped together and the first and last in the group need some kind of curved border-radius or other visual difference.

@Kommynct
Copy link

Yeah, this seems obvious when we have css... why would this not work?

@Alexays Alexays added the question Further information is requested label May 27, 2020
@Alexays
Copy link
Owner

Alexays commented May 27, 2020

On GTK side, hover seem to work only on button and as workspaces use gtk buttons..

@Kommynct
Copy link

Kommynct commented May 27, 2020

Perhaps everything should or at least being considered a button could maybe be toggleable? I certainly click on my other modules, and I find that hinting something is clickable with a hover effect helps ease of use.

@Hermitter
Copy link

Would love to have this as a feature. Being able to apply hover CSS to modules would let me visually differentiate between which ones have clickable actions.

@ghost
Copy link

ghost commented Aug 22, 2020

I could specifically use :hover on #custom-xxx:hover elements

Also, :first-child and :last-child would help in instances where buttons are grouped together and the first and last in the group need some kind of curved border-radius or other visual difference.

I was able to put the entire box inside another box layer, from which I could I could group together the modules in their own boxes.. basically just wrapping and grouping everything together. This allows the bars to resize based on text/components and hover features while allowing a minimal space to be occupied.

If I could just figure out how to incorporate a hover feature to the entire bar, without having to rewrite the entire code - where the entire bar just becomes a height of 2px and transparent - this would be the dream bar.
screenshot-23

@mizzunet
Copy link

mizzunet commented Dec 7, 2021

Any update on this?

#clock:hover {
     backround:#232332;
}

I'd like to have this CSS setting

@Zaedus
Copy link

Zaedus commented Jun 4, 2022

For those of y'all who are want those cool animations for hovering, I found a pretty good way to do it. Hover effects seem to be exclusive to GtkButtons. I checked out PR #1120 because it forced elements with an on-click event to be GtkButtons. From there I could do whatever :hover stuff I wanted.

cute-rhEbV.mp4

This might be a bit too brief, so if you have any questions please ask, I've definitely had a few complications. For instance, the actual label is nested inside the Button so when, for example, setting the label color, you need to do the following.

#mycoolclass label {
 color: blue;
}

NOTE: By using #1120 you will probably have a lot of spacing issues because of this nested GtkLabel having its own margin and padding so keep that in mind when switching to it.

@rnestler
Copy link
Contributor

rnestler commented Nov 9, 2022

Since I had unexpected hover effects everywhere where I have an on-click definition after upgrading to 0.9.15 I guess this is now fixed 🙂

@Alexays Alexays closed this as completed Nov 15, 2022
@zerkalica
Copy link

It's possible to rewrite all modules from ALabel to Button?

https://github.com/Alexays/Waybar/blob/master/src/modules/custom.cpp#L7

@spikespaz
Copy link
Contributor

spikespaz commented Jan 16, 2023

@zerkalica Is this why I'm having problems?

From what I read, anything with an on-click handler is supposed to be a gtkmm__GtkButton, however, the #bluetooth widget is not a button but rather a GtkEventBox containing a GtkLabel. This makes it impossible to use #bluetooth:hover as a valid selector.

@izelnakri
Copy link

@Alexays This seems like a major drawback of Waybar that has not been addressed, in addition this issue seems to be closed, could you reopen this issue?

window#waybar should have an :hover state or at least .horizontal:hover. It shouldn't be only buttons as it is very confusing and undocumented mismatch.

@loegaire
Copy link

and :hover on on-click elements stop working again...

@notmugi
Copy link

notmugi commented Oct 26, 2023

why is this issue closed? this is a really fundamental part of css thats straight up being ignored. i cant even get custom on-click functions to hover anymore. whats up with that? feels like an oversight that the only things hoverable are workspaces.

@spikespaz
Copy link
Contributor

Not sure if you guys have looked into the source, but there's no QC...

@zlietapki
Copy link

zlietapki commented Dec 12, 2023

#custom-XXX:hover still not work. Even with on-click exists

"custom/apps": {
    "format": "Apps",
    "on-click": "pkill -x rofi || rofi -show drun"
},
#custom-apps:hover {
    color: red;
}

@phrogg
Copy link

phrogg commented Jan 3, 2024

I also would love to have this!

@5p4r74cu5
Copy link

Damn this isn't a thing yet.

@mkaramuk
Copy link

mkaramuk commented Feb 5, 2024

Does this feature implemented or will it? I tried #custom-module button.focuesed and :hover but it doesn't works. The module has on-click event too.

@SammySul
Copy link

SammySul commented Mar 1, 2024

it doesnt seem to be possible unfortunately

@EaGLexEyE
Copy link

And the issue is still closed.

@rnestler
Copy link
Contributor

rnestler commented Mar 5, 2024

Well it worked at some point, but then got removed again since it caused issues. Maybe it would be worth to create a new feature request for it?

@5p4r74cu5
Copy link

Done: #2989.

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

No branches or pull requests