-
Notifications
You must be signed in to change notification settings - Fork 814
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 |
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: