feat: unify theme system #7

Merged
reya merged 14 commits from unify-theme into master 2026-11-16 12:58:35 +00:00
2 changed files with 5 additions and 7 deletions
Showing only changes of commit eaea1a4943 - Show all commits
+1 -2
View File
@@ -19,7 +19,6 @@ use gpui_native_theme::{
ActiveTheme as _, CARET_WIDTH, ColorTokens, DISABLED_OPACITY, Size, UNDERLINE_WIDTH, ActiveTheme as _, CARET_WIDTH, ColorTokens, DISABLED_OPACITY, Size, UNDERLINE_WIDTH,
WHEEL_LINE_HEIGHT, WHEEL_LINE_HEIGHT,
}; };
use gpui_native_utils::focus_ring;
use crate::button::{Button, ButtonVariant}; use crate::button::{Button, ButtonVariant};
use crate::common::{Sizable, StyledExt as _, h_flex}; use crate::common::{Sizable, StyledExt as _, h_flex};
@@ -2160,7 +2159,7 @@ impl RenderOnce for Input {
.when(!self.disabled, |input| { .when(!self.disabled, |input| {
input.track_focus(&focus_handle).tab_stop(true) input.track_focus(&focus_handle).tab_stop(true)
}) })
.when(focused, |input| input.shadow(focus_ring(colors.ring))) .when(focused, |input| input.border_color(colors.ring))
.when_some(self.prefix, |input, prefix| { .when_some(self.prefix, |input, prefix| {
input.child(edge_zone("input-prefix", prefix)) input.child(edge_zone("input-prefix", prefix))
}) })
+4 -5
View File
@@ -8,7 +8,7 @@ use gpui::{
}; };
use gpui_native_icons::{Icon, IconRole, icon}; use gpui_native_icons::{Icon, IconRole, icon};
use gpui_native_theme::{ActiveTheme as _, Size}; use gpui_native_theme::{ActiveTheme as _, Size};
use gpui_native_utils::{focus_handle, focus_ring}; use gpui_native_utils::focus_handle;
use crate::common::{Sizable, StyledExt, h_flex}; use crate::common::{Sizable, StyledExt, h_flex};
use crate::menu::{Menu, MenuItem}; use crate::menu::{Menu, MenuItem};
@@ -207,8 +207,8 @@ where
let is_open = *open.read(cx); let is_open = *open.read(cx);
let open_for_items = open.clone(); let open_for_items = open.clone();
let rest_border = border; let rest_border = if is_open { ring } else { border };
let hover_border = border; let hover_border = rest_border;
let selected_index = self.selected.as_ref().and_then(|value| { let selected_index = self.selected.as_ref().and_then(|value| {
self.options self.options
@@ -240,7 +240,7 @@ where
.aria_expanded(is_open) .aria_expanded(is_open)
.track_focus(&focus) .track_focus(&focus)
.tab_stop(true) .tab_stop(true)
.focus_visible(move |style| style.shadow(focus_ring(ring))) .focus_visible(move |style| style.border_color(ring))
.on_key_down({ .on_key_down({
let open = open.clone(); let open = open.clone();
move |event: &KeyDownEvent, _window, cx| { move |event: &KeyDownEvent, _window, cx| {
@@ -269,7 +269,6 @@ where
} else { } else {
muted_foreground muted_foreground
}) })
.when(is_open, |trigger| trigger.shadow(focus_ring(ring)))
.hover(|style| style.bg(muted).border_color(hover_border)) .hover(|style| style.bg(muted).border_color(hover_border))
.child(trigger_text.clone()) .child(trigger_text.clone())
.child( .child(