scrollbar: Opacity scrollbar when not hover on it. (#213)

https://github.com/user-attachments/assets/ea070e6f-3d4c-4a0d-b6da-be34e7dfc579
This commit is contained in:
Jason Lee 2024-09-04 16:48:49 +08:00 committed by GitHub
parent f6b4e5a591
commit 476f97d5e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
use std::{cell::Cell, rc::Rc};
use crate::theme::ActiveTheme;
use crate::theme::{ActiveTheme, Colorize};
use gpui::{
fill, point, px, relative, size, Bounds, ContentMask, Edges, Element, EntityId, Hitbox,
IntoElement, MouseDownEvent, MouseMoveEvent, MouseUpEvent, PaintQuad, Pixels, Point, Position,
@ -372,7 +372,7 @@ impl Element for Scrollbar {
(thumb_bg, cx.theme().scrollbar, cx.theme().border, px(1.))
} else {
(
thumb_bg,
thumb_bg.opacity(0.3),
cx.theme().transparent,
gpui::transparent_black(),
THUMB_INSET,

View file

@ -196,8 +196,8 @@ impl Colors {
input: hsl(240.0, 5.9, 90.0),
ring: hsl(240.0, 5.9, 65.0),
selection: hsl(211.0, 97.0, 85.0),
scrollbar: hsl(0., 0., 97.),
scrollbar_thumb: hsl(0., 0., 49.),
scrollbar: hsl(0., 0., 97.).opacity(0.7),
scrollbar_thumb: hsl(0., 0., 69.),
panel: hsl(0.0, 0.0, 100.0),
tab_bar: hsl(240.0, 4.8, 95.9),
list: hsl(0.0, 0.0, 100.),
@ -237,7 +237,7 @@ impl Colors {
input: hsl(240.0, 3.7, 15.9),
ring: hsl(240.0, 4.9, 83.9),
selection: hsl(211.0, 97.0, 22.0),
scrollbar: hsl(240., 1., 15.),
scrollbar: hsl(240., 1., 15.).opacity(0.7),
scrollbar_thumb: hsl(0., 0., 58.),
panel: hsl(299.0, 2., 9.),
tab_bar: hsl(299.0, 2., 9.),