From 9e4150de8110dc0932c44e3c946d38c68c9bfb34 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 24 Sep 2022 09:20:20 +0100 Subject: [PATCH] replace hack in scrollbars --- src/textual/_styles_cache.py | 2 +- src/textual/scrollbar.py | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/textual/_styles_cache.py b/src/textual/_styles_cache.py index fa3c8fad0..a14877ac7 100644 --- a/src/textual/_styles_cache.py +++ b/src/textual/_styles_cache.py @@ -49,7 +49,7 @@ def style_links( _Segment( text, (style + link_style if style is not None else None) - if (style and style._link_id == link_id) + if (style and not style._null and style._link_id == link_id) else style, control, ) diff --git a/src/textual/scrollbar.py b/src/textual/scrollbar.py index 988a7794b..0d96304eb 100644 --- a/src/textual/scrollbar.py +++ b/src/textual/scrollbar.py @@ -207,6 +207,7 @@ class ScrollBar(Widget): self.thickness = thickness self.grabbed_position: float = 0 super().__init__(name=name) + self.auto_links = False window_virtual_size: Reactive[int] = Reactive(100) window_size: Reactive[int] = Reactive(0) @@ -222,17 +223,6 @@ class ScrollBar(Widget): if self.thickness > 1: yield "thickness", self.thickness - @property - def link_style(self) -> Style: - return NULL_STYLE - - @property - def link_hover_style(self) -> Style: - return NULL_STYLE - - def watch_hover_style(self, old_style: Style, new_style: Style) -> None: - pass - def render(self) -> RenderableType: styles = self.parent.styles background = (