Skip to content

Commit

Permalink
Fix #1479.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigogiraoserrao committed Jan 4, 2023
1 parent aaad1a3 commit 906fc6e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/textual/scrollbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,15 @@ def __rich_repr__(self) -> rich.repr.Result:

def render(self) -> RenderableType:
styles = self.parent.styles
background = (
styles.scrollbar_background_hover
if self.mouse_over
else styles.scrollbar_background
)
color = (
styles.scrollbar_color_active if self.grabbed else styles.scrollbar_color
)
if self.grabbed:
background = styles.scrollbar_background_active
color = styles.scrollbar_color_active
elif self.mouse_over:
background = styles.scrollbar_background_hover
color = styles.scrollbar_color_hover
else:
background = styles.scrollbar_background
color = styles.scrollbar_color
color = background + color
scrollbar_style = Style.from_color(color.rich_color, background.rich_color)
return ScrollBarRender(
Expand Down

0 comments on commit 906fc6e

Please sign in to comment.