-
Notifications
You must be signed in to change notification settings - Fork 848
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
Mouse hover highlighting of a ListItem
in a ListView
works in unexpected ways
#3030
Comments
The 'inverse' seems to happen when a |
Aye, for the same reason above. I just did it the above way as it's easier to see. |
I got that, 😉. Sorry for not making that clear. I like your code BTW, very concise. |
I didn't even realise there was a hover highlight in I'm wondering if the styling should be closer to the from textual.app import App, ComposeResult
from textual.containers import Horizontal
from textual.widgets import Label, ListItem, ListView, OptionList
from textual.widgets.option_list import Option
class ExampleApp(App):
def compose(self) -> ComposeResult:
with Horizontal():
yield ListView(
ListItem(Label("One")),
ListItem(Label("Two")),
ListItem(Label("Three")),
)
yield OptionList(
Option("One"),
Option("Two"),
Option("Three"),
)
if __name__ == "__main__":
app = ExampleApp()
app.run() |
So... is an |
A For example a |
Also, further to what Tom says, each item in a
|
We still have #1780 kicking about which, in part, has been diluted by some of the recent style revamping @willmcgugan did, but there's still a wee bit more work to day (in part the idea of adding some more Edit to add: #1704 |
So, an |
I wouldn't personally characterise it like that as I think it misses the fact that they're very distinct classes of widget that serve very different purposes. I think it makes more sense to view |
I stumbled on this old issue looking for something else. The highlighting must have been fixed at some point, as I can't reproduce this on Textual v1.0! |
Can confirm that the issue was present in 0.30.0, but is resolved in 1.0.0. And probably some time before that, ;-). Anyway, since I was the one originally asking about this on Discord, and @davep was kind enough to create the issue, I'll close it. Wait, I don't have permission to do that, haha. |
Allow me... |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Given this code:
note that the
:hover
highlight only appears when the mouse is hovered over the "empty" part of the item in the list, not when over the text. The reason would seem to be:in the code for
ListItem
; which means that the background boost only happens when (in the case of the example code above) the mouse is over theHorizontal
, but not when it's over theLabel
.The text was updated successfully, but these errors were encountered: