scrollbar: Smaller the scrollbar size. (#294)

<img width="918" alt="image"
src="https://github.com/user-attachments/assets/787766ab-63eb-4568-972b-5abd668511f7">
This commit is contained in:
Jason Lee 2024-10-02 18:15:53 +08:00 committed by GitHub
parent 6f1be83b6e
commit 33e5fdcb78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 13 deletions

View file

@ -180,18 +180,20 @@ impl ListDelegate for CompanyListDelegate {
.border_color(cx.theme().muted_foreground.opacity(0.3)) .border_color(cx.theme().muted_foreground.opacity(0.3))
.line_height(relative(1.)) .line_height(relative(1.))
.p_1() .p_1()
.child(div().child(name).text_xs()) .child(div().whitespace_nowrap().child(name).text_xs())
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let element = v_flex() let element = v_flex()
.p_4() .p_4()
.child( .child(
v_flex() v_flex().gap_y_2().child("History").child(
.gap_y_2() h_flex()
.child("History") .gap_x_4()
.child(h_flex().gap_x_4().children(input_history)), .gap_y_2()
.flex_wrap()
.children(input_history),
),
) )
.into_any_element(); .into_any_element();
Some(element) Some(element)

View file

@ -16,7 +16,7 @@ use crate::{
popup_menu::{PopupMenu, PopupMenuExt}, popup_menu::{PopupMenu, PopupMenuExt},
tab::{Tab, TabBar}, tab::{Tab, TabBar},
theme::ActiveTheme, theme::ActiveTheme,
v_flex, AxisExt, IconName, Placement, Selectable, Sizable, StyledExt, v_flex, AxisExt, IconName, Placement, Selectable, Sizable,
}; };
use super::{ use super::{
@ -473,12 +473,10 @@ impl TabPanel {
div() div()
.id("tab") .id("tab")
.flex_1() .flex_1()
.debug_red()
.min_w_16() .min_w_16()
.overflow_hidden() .overflow_hidden()
.text_ellipsis() .text_ellipsis()
.whitespace_nowrap() .whitespace_nowrap()
.debug_green()
.child(panel.title(cx)) .child(panel.title(cx))
.when(self.can_split(), |this| { .when(self.can_split(), |this| {
this.on_drag( this.on_drag(

View file

@ -162,7 +162,7 @@ impl Scrollbar {
state, state,
axis, axis,
scroll_size, scroll_size,
width: px(11.), width: px(8.),
scroll_handle: Rc::new(Box::new(scroll_handle)), scroll_handle: Rc::new(Box::new(scroll_handle)),
} }
} }

View file

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