migrate ui crate to new theme tokens
This commit is contained in:
@@ -6,7 +6,7 @@ use gpui::{
|
||||
};
|
||||
use gpui_base::InputBase;
|
||||
use gpui_base::input::{InputBaseState, InputEditorStyle, InputMode, InputModeKind, TextareaMode};
|
||||
use theme::ActiveTheme;
|
||||
use theme::{ActiveTheme, button_radius};
|
||||
|
||||
use crate::indicator::Indicator;
|
||||
use crate::input::clear_button;
|
||||
@@ -15,9 +15,9 @@ use crate::{Sizable, Size, StyleSized, StyledExt, h_flex, v_flex};
|
||||
/// The background of an input frame, which reads muted while the input is disabled.
|
||||
fn input_background(disabled: bool, cx: &App) -> Hsla {
|
||||
if disabled {
|
||||
cx.theme().surface_background
|
||||
cx.theme().surface
|
||||
} else {
|
||||
cx.theme().elevated_surface_background
|
||||
cx.theme().input_bg
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,11 +26,11 @@ fn input_editor_style(cx: &App) -> InputEditorStyle {
|
||||
let theme = cx.theme();
|
||||
InputEditorStyle {
|
||||
foreground: theme.text,
|
||||
muted_foreground: theme.text_muted,
|
||||
background: theme.elevated_surface_background,
|
||||
border: theme.border,
|
||||
muted_foreground: theme.text_faint,
|
||||
background: theme.input_bg,
|
||||
border: theme.border_faint,
|
||||
selection: theme.selection,
|
||||
caret: theme.cursor,
|
||||
caret: theme.caret,
|
||||
..InputEditorStyle::default()
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ impl<M: InputModeKind> RenderOnce for Input<M> {
|
||||
.when(self.appearance, |this| {
|
||||
this.bg(background)
|
||||
.when(self.disabled, |this| this.opacity(0.5))
|
||||
.rounded(cx.theme().radius)
|
||||
.rounded(px(button_radius()))
|
||||
})
|
||||
.tab_index(0)
|
||||
.gap(gap_x)
|
||||
|
||||
Reference in New Issue
Block a user