We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Checked closed issues? Yes.
The scrollbar should reflect CSS changes (scrollbar-color) immediately.
scrollbar-color
The scrollbar does not change until one scrolls or mouse-enters the scrollbar. The MRE below reflects the issue.
#!/usr/bin/env python3 from textual.app import App, ComposeResult from textual.containers import ScrollableContainer from textual.widgets import Static, Footer class MyBoringWidget(Static, can_focus=True): DEFAULT_CSS = "MyBoringWidget { height: 90%; background: $primary; border: tall yellow; }" class ScrollMRE(App): CSS = """ ScrollableContainer { scrollbar-color: ansi_bright_red; scrollbar-color-active: ansi_bright_red; scrollbar-color-hover: ansi_bright_red; } ScrollableContainer.foo { scrollbar-color: ansi_bright_green; scrollbar-color-active: ansi_bright_green; scrollbar-color-hover: ansi_bright_green; } Static { text-align: center; } """ BINDINGS = [ ('ctrl+f', 'toggle', 'Toggle scrollbar handle color'), ('ctrl+w', 'workaround', 'Toggle workaround'), ] def action_workaround(self): self.workaround = not self.workaround def action_toggle(self): self.scrollable_container.toggle_class('foo') if self.workaround: scrollbar = self.scrollable_container.vertical_scrollbar value = scrollbar.mouse_over scrollbar.mouse_over = not value scrollbar.mouse_over = value def compose(self) -> ComposeResult: self.workaround = False self.scrollable_container = ScrollableContainer() with self.scrollable_container: yield Static('Hit Ctrl+f. Expectations: the scrollbar handle should change color immediately') yield MyBoringWidget() yield Static('Actual behaviour: it does not change until one scrolls') yield MyBoringWidget() yield Static('Hit Ctrl+w to enable the workwaround') yield Footer() if __name__ == "__main__": app = ScrollMRE() app.run()
The text was updated successfully, but these errors were encountered:
Thank you for your issue. Give us a little time to review it.
PS. You might want to check the FAQ if you haven't done so already.
This is an automated reply, generated by FAQtory
Sorry, something went wrong.
Don't forget to star the repository!
Follow @textualizeio for Textual updates.
programmatic scrolling: remove obsolete workaround.
4135e0c
This workaround was meant for Textualize/textual#4425 and is no longer necessary as Moulti now requires Textual >= 0.76.0.
Successfully merging a pull request may close this issue.
Context
Checked closed issues? Yes.
Expectations
The scrollbar should reflect CSS changes (
scrollbar-color
) immediately.Current behaviour
The scrollbar does not change until one scrolls or mouse-enters the scrollbar.
The MRE below reflects the issue.
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: