Use focus borders for inputs and selects

- Replace the input focus shadow with an accent border.
- Apply the same focus border to select triggers.
This commit is contained in:
2026-11-16 18:39:06 +07:00
parent 2c92f26e20
commit eaea1a4943
2 changed files with 5 additions and 7 deletions
+1 -2
View File
@@ -19,7 +19,6 @@ use gpui_native_theme::{
ActiveTheme as _, CARET_WIDTH, ColorTokens, DISABLED_OPACITY, Size, UNDERLINE_WIDTH,
WHEEL_LINE_HEIGHT,
};
use gpui_native_utils::focus_ring;
use crate::button::{Button, ButtonVariant};
use crate::common::{Sizable, StyledExt as _, h_flex};
@@ -2160,7 +2159,7 @@ impl RenderOnce for Input {
.when(!self.disabled, |input| {
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| {
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_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::menu::{Menu, MenuItem};
@@ -207,8 +207,8 @@ where
let is_open = *open.read(cx);
let open_for_items = open.clone();
let rest_border = border;
let hover_border = border;
let rest_border = if is_open { ring } else { border };
let hover_border = rest_border;
let selected_index = self.selected.as_ref().and_then(|value| {
self.options
@@ -240,7 +240,7 @@ where
.aria_expanded(is_open)
.track_focus(&focus)
.tab_stop(true)
.focus_visible(move |style| style.shadow(focus_ring(ring)))
.focus_visible(move |style| style.border_color(ring))
.on_key_down({
let open = open.clone();
move |event: &KeyDownEvent, _window, cx| {
@@ -269,7 +269,6 @@ where
} else {
muted_foreground
})
.when(is_open, |trigger| trigger.shadow(focus_ring(ring)))
.hover(|style| style.bg(muted).border_color(hover_border))
.child(trigger_text.clone())
.child(