feat: unify theme system (#7)

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
2026-11-16 12:58:32 +00:00
parent 745a01d7af
commit aed3601c89
47 changed files with 888 additions and 1875 deletions
+1
View File
@@ -224,6 +224,7 @@ impl ListItem {
.gap_2()
.px_2()
.py_1()
.min_h(theme.sizes.medium.control_height)
.rounded(theme.radius.sm)
.role(Role::ListItem)
.aria_selected(selected)
+6 -3
View File
@@ -8,11 +8,13 @@ use gpui::prelude::FluentBuilder;
use gpui::{
AnyElement, App, ElementId, FocusHandle, InteractiveElement as _, IntoElement, KeyDownEvent,
ParentElement as _, Pixels, RenderOnce, Role, SharedString, StatefulInteractiveElement as _,
StyleRefinement, Styled as _, Window, div, px,
StyleRefinement, Styled as _, Window, div,
};
use gpui_native_core::grain::grain as grain_overlay;
use gpui_native_core::scroll_area::ScrollArea;
use gpui_native_theme::{ActiveTheme as _, BORDER_WIDTH, TextRole, Typeset as _};
use gpui_native_theme::{
ActiveTheme as _, BORDER_WIDTH, SIDEBAR_DEFAULT_WIDTH, TextRole, Typeset as _,
};
use gpui_native_utils::{StyledExt as _, nav_key, paint_selectable_row, selectable_label_color};
/// The change reporter, fired with the next selected row by pointer and keys.
@@ -160,7 +162,7 @@ impl Sidebar {
grain: false,
border_right: true,
padded: true,
width: px(240.0),
width: SIDEBAR_DEFAULT_WIDTH,
a11y_label: None,
on_change: None,
entries: None,
@@ -463,6 +465,7 @@ impl SidebarEntry {
.gap_2()
.px_2()
.py_1()
.min_h(theme.sizes.medium.control_height)
.rounded(theme.radius.sm)
.role(Role::ListItem)
.aria_selected(selected)
+9 -9
View File
@@ -16,7 +16,7 @@ use gpui_native_core::scroll_area::{ScrollArea, ScrollAxes};
use gpui_native_core::spinner::Spinner;
use gpui_native_core::tooltip::Tooltip;
use gpui_native_icons::IconRole;
use gpui_native_theme::{ActiveTheme as _, POPUP_MAX_HEIGHT, Size};
use gpui_native_theme::{ActiveTheme as _, POPUP_MAX_HEIGHT, Size, TAB_INDICATOR_WIDTH};
use gpui_native_utils::{StyledExt as _, adjacent_selectable};
/// Reports the next selected tab by pointer and keys.
@@ -609,7 +609,7 @@ impl Tabs {
})
.flex()
.items_center()
.gap_1p5()
.gap_2()
.cursor_pointer()
.role(Role::Tab)
.aria_selected(selected)
@@ -624,7 +624,7 @@ impl Tabs {
.py_1()
.rounded_tl(theme.radius.sm)
.rounded_tr(theme.radius.sm)
.border_b_2()
.border_b(TAB_INDICATOR_WIDTH)
.border_color(gpui::transparent_black())
.when(active, |chip| chip.border_color(theme.ramps.primary.base)),
TabsVariant::Pill => chip
@@ -1019,7 +1019,7 @@ impl Tab {
})
.flex()
.items_center()
.gap_1p5()
.gap_2()
.role(Role::Tab)
.aria_selected(selected)
.text_color(label_color)
@@ -1033,7 +1033,7 @@ impl Tab {
.py_1()
.rounded_tl(theme.radius.sm)
.rounded_tr(theme.radius.sm)
.border_b_2()
.border_b(TAB_INDICATOR_WIDTH)
.border_color(gpui::transparent_black())
.when(active, |strip_tab| {
strip_tab.border_color(theme.ramps.primary.base)
@@ -1072,9 +1072,9 @@ impl Tab {
div()
.absolute()
.left_0()
.top(px(2.0))
.bottom(px(2.0))
.w(px(2.0))
.top(TAB_INDICATOR_WIDTH)
.bottom(TAB_INDICATOR_WIDTH)
.w(TAB_INDICATOR_WIDTH)
.rounded(theme.radius.sm)
.bg(theme.ramps.primary.base),
)
@@ -1201,7 +1201,7 @@ impl Tab {
Button::new((self.key.clone(), "tab-close"))
.icon(IconRole::Close)
.variant(ButtonVariant::Ghost)
.small()
.xsmall()
.tab_stop(false)
.debug_selector({
let tabs_id = tabs_id.clone();
+1
View File
@@ -354,6 +354,7 @@ impl TreeItem {
.pl(indent)
.pr_2()
.py_1()
.min_h(theme.sizes.medium.control_height)
.rounded(theme.radius.sm)
.role(Role::TreeItem)
.aria_selected(selected)