diff --git a/assets/themes/cave-dark.json b/assets/themes/cave-dark.json index 85734d9f05..a33125d5b3 100644 --- a/assets/themes/cave-dark.json +++ b/assets/themes/cave-dark.json @@ -1,5 +1,5 @@ { - "selector": { + "picker": { "background": "#26232a", "corner_radius": 8, "padding": 8, diff --git a/assets/themes/cave-light.json b/assets/themes/cave-light.json index 8e0da2e31f..0b1551942d 100644 --- a/assets/themes/cave-light.json +++ b/assets/themes/cave-light.json @@ -1,5 +1,5 @@ { - "selector": { + "picker": { "background": "#e2dfe7", "corner_radius": 8, "padding": 8, diff --git a/assets/themes/dark.json b/assets/themes/dark.json index f88d2bb080..616b15f005 100644 --- a/assets/themes/dark.json +++ b/assets/themes/dark.json @@ -1,5 +1,5 @@ { - "selector": { + "picker": { "background": "#1c1c1c", "corner_radius": 8, "padding": 8, diff --git a/assets/themes/light.json b/assets/themes/light.json index 2afe457195..71a4a65b62 100644 --- a/assets/themes/light.json +++ b/assets/themes/light.json @@ -1,5 +1,5 @@ { - "selector": { + "picker": { "background": "#f8f8f8", "corner_radius": 8, "padding": 8, diff --git a/assets/themes/solarized-dark.json b/assets/themes/solarized-dark.json index 8cb536ecbd..b8ac7767d0 100644 --- a/assets/themes/solarized-dark.json +++ b/assets/themes/solarized-dark.json @@ -1,5 +1,5 @@ { - "selector": { + "picker": { "background": "#073642", "corner_radius": 8, "padding": 8, diff --git a/assets/themes/solarized-light.json b/assets/themes/solarized-light.json index f68b4f477e..d8aaa3f130 100644 --- a/assets/themes/solarized-light.json +++ b/assets/themes/solarized-light.json @@ -1,5 +1,5 @@ { - "selector": { + "picker": { "background": "#eee8d5", "corner_radius": 8, "padding": 8, diff --git a/assets/themes/sulphurpool-dark.json b/assets/themes/sulphurpool-dark.json index 57d7e5a5d4..c278439765 100644 --- a/assets/themes/sulphurpool-dark.json +++ b/assets/themes/sulphurpool-dark.json @@ -1,5 +1,5 @@ { - "selector": { + "picker": { "background": "#293256", "corner_radius": 8, "padding": 8, diff --git a/assets/themes/sulphurpool-light.json b/assets/themes/sulphurpool-light.json index 4de63ce75f..f537a7110e 100644 --- a/assets/themes/sulphurpool-light.json +++ b/assets/themes/sulphurpool-light.json @@ -1,5 +1,5 @@ { - "selector": { + "picker": { "background": "#dfe2f1", "corner_radius": 8, "padding": 8, diff --git a/crates/command_palette/src/command_palette.rs b/crates/command_palette/src/command_palette.rs index 5e3b3eb5dd..7f14747903 100644 --- a/crates/command_palette/src/command_palette.rs +++ b/crates/command_palette/src/command_palette.rs @@ -206,9 +206,9 @@ impl PickerDelegate for CommandPalette { let settings = cx.global::(); let theme = &settings.theme; let style = if selected { - &theme.selector.active_item + &theme.picker.active_item } else { - &theme.selector.item + &theme.picker.item }; let key_style = &theme.command_palette.key; let keystroke_spacing = theme.command_palette.keystroke_spacing; diff --git a/crates/file_finder/src/file_finder.rs b/crates/file_finder/src/file_finder.rs index ae4110e798..84378bfd24 100644 --- a/crates/file_finder/src/file_finder.rs +++ b/crates/file_finder/src/file_finder.rs @@ -227,9 +227,9 @@ impl PickerDelegate for FileFinder { let path_match = &self.matches[ix]; let settings = cx.global::(); let style = if selected { - &settings.theme.selector.active_item + &settings.theme.picker.active_item } else { - &settings.theme.selector.item + &settings.theme.picker.item }; let (file_name, file_name_positions, full_path, full_path_positions) = self.labels_for_match(path_match); diff --git a/crates/go_to_line/src/go_to_line.rs b/crates/go_to_line/src/go_to_line.rs index b8d9b5e5b1..3f8aa933ba 100644 --- a/crates/go_to_line/src/go_to_line.rs +++ b/crates/go_to_line/src/go_to_line.rs @@ -33,7 +33,7 @@ pub enum Event { impl GoToLine { pub fn new(active_editor: ViewHandle, cx: &mut ViewContext) -> Self { let line_editor = cx.add_view(|cx| { - Editor::single_line(Some(|theme| theme.selector.input_editor.clone()), cx) + Editor::single_line(Some(|theme| theme.picker.input_editor.clone()), cx) }); cx.subscribe(&line_editor, Self::on_line_editor_event) .detach(); @@ -152,7 +152,7 @@ impl View for GoToLine { } fn render(&mut self, cx: &mut RenderContext) -> ElementBox { - let theme = &cx.global::().theme.selector; + let theme = &cx.global::().theme.picker; let label = format!( "{},{} of {} lines", diff --git a/crates/outline/src/outline.rs b/crates/outline/src/outline.rs index 2ff5c4a57f..a8216038c8 100644 --- a/crates/outline/src/outline.rs +++ b/crates/outline/src/outline.rs @@ -232,9 +232,9 @@ impl PickerDelegate for OutlineView { let settings = cx.global::(); let string_match = &self.matches[ix]; let style = if selected { - &settings.theme.selector.active_item + &settings.theme.picker.active_item } else { - &settings.theme.selector.item + &settings.theme.picker.item }; let outline_item = &self.outline.items[string_match.candidate_id]; diff --git a/crates/picker/src/picker.rs b/crates/picker/src/picker.rs index 0c90268dad..d5bd2dcfea 100644 --- a/crates/picker/src/picker.rs +++ b/crates/picker/src/picker.rs @@ -57,17 +57,17 @@ impl View for Picker { .with_child( ChildView::new(&self.query_editor) .contained() - .with_style(settings.theme.selector.input_editor.container) + .with_style(settings.theme.picker.input_editor.container) .boxed(), ) .with_child( if match_count == 0 { Label::new( "No matches".into(), - settings.theme.selector.empty.label.clone(), + settings.theme.picker.empty.label.clone(), ) .contained() - .with_style(settings.theme.selector.empty.container) + .with_style(settings.theme.picker.empty.container) } else { UniformList::new( self.list_state.clone(), @@ -95,7 +95,7 @@ impl View for Picker { .boxed(), ) .contained() - .with_style(settings.theme.selector.container) + .with_style(settings.theme.picker.container) .constrained() .with_max_width(self.max_size.x()) .with_max_height(self.max_size.y()) @@ -126,7 +126,7 @@ impl Picker { pub fn new(delegate: WeakViewHandle, cx: &mut ViewContext) -> Self { let query_editor = cx.add_view(|cx| { - Editor::single_line(Some(|theme| theme.selector.input_editor.clone()), cx) + Editor::single_line(Some(|theme| theme.picker.input_editor.clone()), cx) }); cx.subscribe(&query_editor, Self::on_query_editor_event) .detach(); diff --git a/crates/project_symbols/src/project_symbols.rs b/crates/project_symbols/src/project_symbols.rs index d2c6850e8b..a4e3d6360e 100644 --- a/crates/project_symbols/src/project_symbols.rs +++ b/crates/project_symbols/src/project_symbols.rs @@ -224,9 +224,9 @@ impl PickerDelegate for ProjectSymbolsView { let string_match = &self.matches[ix]; let settings = cx.global::(); let style = if selected { - &settings.theme.selector.active_item + &settings.theme.picker.active_item } else { - &settings.theme.selector.item + &settings.theme.picker.item }; let symbol = &self.symbols[string_match.candidate_id]; let syntax_runs = styled_runs_for_code_label(&symbol.label, &settings.theme.editor.syntax); @@ -259,7 +259,7 @@ impl PickerDelegate for ProjectSymbolsView { .with_child( // Avoid styling the path differently when it is selected, since // the symbol's syntax highlighting doesn't change when selected. - Label::new(path.to_string(), settings.theme.selector.item.label.clone()).boxed(), + Label::new(path.to_string(), settings.theme.picker.item.label.clone()).boxed(), ) .contained() .with_style(style.container) diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index 3fb31d78b1..bc9bf5643d 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -23,7 +23,7 @@ pub struct Theme { pub contacts_panel: ContactsPanel, pub project_panel: ProjectPanel, pub command_palette: CommandPalette, - pub selector: Selector, + pub picker: Picker, pub editor: Editor, pub search: Search, pub project_diagnostics: ProjectDiagnostics, @@ -288,7 +288,7 @@ pub struct ChannelName { } #[derive(Deserialize, Default)] -pub struct Selector { +pub struct Picker { #[serde(flatten)] pub container: ContainerStyle, pub empty: ContainedLabel, @@ -410,7 +410,7 @@ pub struct FieldEditor { pub selection: SelectionStyle, } -#[derive(Default, Clone, Copy)] +#[derive(Debug, Default, Clone, Copy)] pub struct Interactive { pub default: T, pub hover: Option, diff --git a/crates/theme_selector/src/theme_selector.rs b/crates/theme_selector/src/theme_selector.rs index 5c679be841..0eff202ea5 100644 --- a/crates/theme_selector/src/theme_selector.rs +++ b/crates/theme_selector/src/theme_selector.rs @@ -208,9 +208,9 @@ impl PickerDelegate for ThemeSelector { let theme = &settings.theme; let theme_match = &self.matches[ix]; let style = if selected { - &theme.selector.active_item + &theme.picker.active_item } else { - &theme.selector.item + &theme.picker.item }; Label::new(theme_match.string.clone(), style.label.clone()) diff --git a/styles/src/styleTree/app.ts b/styles/src/styleTree/app.ts index a06696de47..1f1dc74c30 100644 --- a/styles/src/styleTree/app.ts +++ b/styles/src/styleTree/app.ts @@ -6,7 +6,7 @@ import commandPalette from "./commandPalette"; import editor from "./editor"; import projectPanel from "./projectPanel"; import search from "./search"; -import selectorModal from "./selectorModal"; +import picker from "./picker"; import workspace from "./workspace"; import projectDiagnostics from "./projectDiagnostics"; @@ -16,7 +16,7 @@ export const panel = { export default function app(theme: Theme): Object { return { - selector: selectorModal(theme), + picker: picker(theme), workspace: workspace(theme), editor: editor(theme), projectDiagnostics: projectDiagnostics(theme), diff --git a/styles/src/styleTree/selectorModal.ts b/styles/src/styleTree/picker.ts similarity index 95% rename from styles/src/styleTree/selectorModal.ts rename to styles/src/styleTree/picker.ts index 8966de9fae..d20bb9dc93 100644 --- a/styles/src/styleTree/selectorModal.ts +++ b/styles/src/styleTree/picker.ts @@ -1,7 +1,7 @@ import Theme from "../themes/theme"; import { backgroundColor, border, player, shadow, text } from "./components"; -export default function selectorModal(theme: Theme): Object { +export default function picker(theme: Theme) { const item = { padding: { bottom: 4,