Rename Selector -> Picker in theme
This commit is contained in:
parent
79fad42424
commit
a60c75e343
18 changed files with 32 additions and 32 deletions
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"selector": {
|
"picker": {
|
||||||
"background": "#26232a",
|
"background": "#26232a",
|
||||||
"corner_radius": 8,
|
"corner_radius": 8,
|
||||||
"padding": 8,
|
"padding": 8,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"selector": {
|
"picker": {
|
||||||
"background": "#e2dfe7",
|
"background": "#e2dfe7",
|
||||||
"corner_radius": 8,
|
"corner_radius": 8,
|
||||||
"padding": 8,
|
"padding": 8,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"selector": {
|
"picker": {
|
||||||
"background": "#1c1c1c",
|
"background": "#1c1c1c",
|
||||||
"corner_radius": 8,
|
"corner_radius": 8,
|
||||||
"padding": 8,
|
"padding": 8,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"selector": {
|
"picker": {
|
||||||
"background": "#f8f8f8",
|
"background": "#f8f8f8",
|
||||||
"corner_radius": 8,
|
"corner_radius": 8,
|
||||||
"padding": 8,
|
"padding": 8,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"selector": {
|
"picker": {
|
||||||
"background": "#073642",
|
"background": "#073642",
|
||||||
"corner_radius": 8,
|
"corner_radius": 8,
|
||||||
"padding": 8,
|
"padding": 8,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"selector": {
|
"picker": {
|
||||||
"background": "#eee8d5",
|
"background": "#eee8d5",
|
||||||
"corner_radius": 8,
|
"corner_radius": 8,
|
||||||
"padding": 8,
|
"padding": 8,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"selector": {
|
"picker": {
|
||||||
"background": "#293256",
|
"background": "#293256",
|
||||||
"corner_radius": 8,
|
"corner_radius": 8,
|
||||||
"padding": 8,
|
"padding": 8,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"selector": {
|
"picker": {
|
||||||
"background": "#dfe2f1",
|
"background": "#dfe2f1",
|
||||||
"corner_radius": 8,
|
"corner_radius": 8,
|
||||||
"padding": 8,
|
"padding": 8,
|
||||||
|
|
|
@ -206,9 +206,9 @@ impl PickerDelegate for CommandPalette {
|
||||||
let settings = cx.global::<Settings>();
|
let settings = cx.global::<Settings>();
|
||||||
let theme = &settings.theme;
|
let theme = &settings.theme;
|
||||||
let style = if selected {
|
let style = if selected {
|
||||||
&theme.selector.active_item
|
&theme.picker.active_item
|
||||||
} else {
|
} else {
|
||||||
&theme.selector.item
|
&theme.picker.item
|
||||||
};
|
};
|
||||||
let key_style = &theme.command_palette.key;
|
let key_style = &theme.command_palette.key;
|
||||||
let keystroke_spacing = theme.command_palette.keystroke_spacing;
|
let keystroke_spacing = theme.command_palette.keystroke_spacing;
|
||||||
|
|
|
@ -227,9 +227,9 @@ impl PickerDelegate for FileFinder {
|
||||||
let path_match = &self.matches[ix];
|
let path_match = &self.matches[ix];
|
||||||
let settings = cx.global::<Settings>();
|
let settings = cx.global::<Settings>();
|
||||||
let style = if selected {
|
let style = if selected {
|
||||||
&settings.theme.selector.active_item
|
&settings.theme.picker.active_item
|
||||||
} else {
|
} else {
|
||||||
&settings.theme.selector.item
|
&settings.theme.picker.item
|
||||||
};
|
};
|
||||||
let (file_name, file_name_positions, full_path, full_path_positions) =
|
let (file_name, file_name_positions, full_path, full_path_positions) =
|
||||||
self.labels_for_match(path_match);
|
self.labels_for_match(path_match);
|
||||||
|
|
|
@ -33,7 +33,7 @@ pub enum Event {
|
||||||
impl GoToLine {
|
impl GoToLine {
|
||||||
pub fn new(active_editor: ViewHandle<Editor>, cx: &mut ViewContext<Self>) -> Self {
|
pub fn new(active_editor: ViewHandle<Editor>, cx: &mut ViewContext<Self>) -> Self {
|
||||||
let line_editor = cx.add_view(|cx| {
|
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)
|
cx.subscribe(&line_editor, Self::on_line_editor_event)
|
||||||
.detach();
|
.detach();
|
||||||
|
@ -152,7 +152,7 @@ impl View for GoToLine {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
|
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
|
||||||
let theme = &cx.global::<Settings>().theme.selector;
|
let theme = &cx.global::<Settings>().theme.picker;
|
||||||
|
|
||||||
let label = format!(
|
let label = format!(
|
||||||
"{},{} of {} lines",
|
"{},{} of {} lines",
|
||||||
|
|
|
@ -232,9 +232,9 @@ impl PickerDelegate for OutlineView {
|
||||||
let settings = cx.global::<Settings>();
|
let settings = cx.global::<Settings>();
|
||||||
let string_match = &self.matches[ix];
|
let string_match = &self.matches[ix];
|
||||||
let style = if selected {
|
let style = if selected {
|
||||||
&settings.theme.selector.active_item
|
&settings.theme.picker.active_item
|
||||||
} else {
|
} else {
|
||||||
&settings.theme.selector.item
|
&settings.theme.picker.item
|
||||||
};
|
};
|
||||||
let outline_item = &self.outline.items[string_match.candidate_id];
|
let outline_item = &self.outline.items[string_match.candidate_id];
|
||||||
|
|
||||||
|
|
|
@ -57,17 +57,17 @@ impl<D: PickerDelegate> View for Picker<D> {
|
||||||
.with_child(
|
.with_child(
|
||||||
ChildView::new(&self.query_editor)
|
ChildView::new(&self.query_editor)
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(settings.theme.selector.input_editor.container)
|
.with_style(settings.theme.picker.input_editor.container)
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
.with_child(
|
.with_child(
|
||||||
if match_count == 0 {
|
if match_count == 0 {
|
||||||
Label::new(
|
Label::new(
|
||||||
"No matches".into(),
|
"No matches".into(),
|
||||||
settings.theme.selector.empty.label.clone(),
|
settings.theme.picker.empty.label.clone(),
|
||||||
)
|
)
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(settings.theme.selector.empty.container)
|
.with_style(settings.theme.picker.empty.container)
|
||||||
} else {
|
} else {
|
||||||
UniformList::new(
|
UniformList::new(
|
||||||
self.list_state.clone(),
|
self.list_state.clone(),
|
||||||
|
@ -95,7 +95,7 @@ impl<D: PickerDelegate> View for Picker<D> {
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(settings.theme.selector.container)
|
.with_style(settings.theme.picker.container)
|
||||||
.constrained()
|
.constrained()
|
||||||
.with_max_width(self.max_size.x())
|
.with_max_width(self.max_size.x())
|
||||||
.with_max_height(self.max_size.y())
|
.with_max_height(self.max_size.y())
|
||||||
|
@ -126,7 +126,7 @@ impl<D: PickerDelegate> Picker<D> {
|
||||||
|
|
||||||
pub fn new(delegate: WeakViewHandle<D>, cx: &mut ViewContext<Self>) -> Self {
|
pub fn new(delegate: WeakViewHandle<D>, cx: &mut ViewContext<Self>) -> Self {
|
||||||
let query_editor = cx.add_view(|cx| {
|
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)
|
cx.subscribe(&query_editor, Self::on_query_editor_event)
|
||||||
.detach();
|
.detach();
|
||||||
|
|
|
@ -224,9 +224,9 @@ impl PickerDelegate for ProjectSymbolsView {
|
||||||
let string_match = &self.matches[ix];
|
let string_match = &self.matches[ix];
|
||||||
let settings = cx.global::<Settings>();
|
let settings = cx.global::<Settings>();
|
||||||
let style = if selected {
|
let style = if selected {
|
||||||
&settings.theme.selector.active_item
|
&settings.theme.picker.active_item
|
||||||
} else {
|
} else {
|
||||||
&settings.theme.selector.item
|
&settings.theme.picker.item
|
||||||
};
|
};
|
||||||
let symbol = &self.symbols[string_match.candidate_id];
|
let symbol = &self.symbols[string_match.candidate_id];
|
||||||
let syntax_runs = styled_runs_for_code_label(&symbol.label, &settings.theme.editor.syntax);
|
let syntax_runs = styled_runs_for_code_label(&symbol.label, &settings.theme.editor.syntax);
|
||||||
|
@ -259,7 +259,7 @@ impl PickerDelegate for ProjectSymbolsView {
|
||||||
.with_child(
|
.with_child(
|
||||||
// Avoid styling the path differently when it is selected, since
|
// Avoid styling the path differently when it is selected, since
|
||||||
// the symbol's syntax highlighting doesn't change when selected.
|
// 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()
|
.contained()
|
||||||
.with_style(style.container)
|
.with_style(style.container)
|
||||||
|
|
|
@ -23,7 +23,7 @@ pub struct Theme {
|
||||||
pub contacts_panel: ContactsPanel,
|
pub contacts_panel: ContactsPanel,
|
||||||
pub project_panel: ProjectPanel,
|
pub project_panel: ProjectPanel,
|
||||||
pub command_palette: CommandPalette,
|
pub command_palette: CommandPalette,
|
||||||
pub selector: Selector,
|
pub picker: Picker,
|
||||||
pub editor: Editor,
|
pub editor: Editor,
|
||||||
pub search: Search,
|
pub search: Search,
|
||||||
pub project_diagnostics: ProjectDiagnostics,
|
pub project_diagnostics: ProjectDiagnostics,
|
||||||
|
@ -288,7 +288,7 @@ pub struct ChannelName {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Default)]
|
#[derive(Deserialize, Default)]
|
||||||
pub struct Selector {
|
pub struct Picker {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub container: ContainerStyle,
|
pub container: ContainerStyle,
|
||||||
pub empty: ContainedLabel,
|
pub empty: ContainedLabel,
|
||||||
|
@ -410,7 +410,7 @@ pub struct FieldEditor {
|
||||||
pub selection: SelectionStyle,
|
pub selection: SelectionStyle,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Clone, Copy)]
|
#[derive(Debug, Default, Clone, Copy)]
|
||||||
pub struct Interactive<T> {
|
pub struct Interactive<T> {
|
||||||
pub default: T,
|
pub default: T,
|
||||||
pub hover: Option<T>,
|
pub hover: Option<T>,
|
||||||
|
|
|
@ -208,9 +208,9 @@ impl PickerDelegate for ThemeSelector {
|
||||||
let theme = &settings.theme;
|
let theme = &settings.theme;
|
||||||
let theme_match = &self.matches[ix];
|
let theme_match = &self.matches[ix];
|
||||||
let style = if selected {
|
let style = if selected {
|
||||||
&theme.selector.active_item
|
&theme.picker.active_item
|
||||||
} else {
|
} else {
|
||||||
&theme.selector.item
|
&theme.picker.item
|
||||||
};
|
};
|
||||||
|
|
||||||
Label::new(theme_match.string.clone(), style.label.clone())
|
Label::new(theme_match.string.clone(), style.label.clone())
|
||||||
|
|
|
@ -6,7 +6,7 @@ import commandPalette from "./commandPalette";
|
||||||
import editor from "./editor";
|
import editor from "./editor";
|
||||||
import projectPanel from "./projectPanel";
|
import projectPanel from "./projectPanel";
|
||||||
import search from "./search";
|
import search from "./search";
|
||||||
import selectorModal from "./selectorModal";
|
import picker from "./picker";
|
||||||
import workspace from "./workspace";
|
import workspace from "./workspace";
|
||||||
import projectDiagnostics from "./projectDiagnostics";
|
import projectDiagnostics from "./projectDiagnostics";
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ export const panel = {
|
||||||
|
|
||||||
export default function app(theme: Theme): Object {
|
export default function app(theme: Theme): Object {
|
||||||
return {
|
return {
|
||||||
selector: selectorModal(theme),
|
picker: picker(theme),
|
||||||
workspace: workspace(theme),
|
workspace: workspace(theme),
|
||||||
editor: editor(theme),
|
editor: editor(theme),
|
||||||
projectDiagnostics: projectDiagnostics(theme),
|
projectDiagnostics: projectDiagnostics(theme),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Theme from "../themes/theme";
|
import Theme from "../themes/theme";
|
||||||
import { backgroundColor, border, player, shadow, text } from "./components";
|
import { backgroundColor, border, player, shadow, text } from "./components";
|
||||||
|
|
||||||
export default function selectorModal(theme: Theme): Object {
|
export default function picker(theme: Theme) {
|
||||||
const item = {
|
const item = {
|
||||||
padding: {
|
padding: {
|
||||||
bottom: 4,
|
bottom: 4,
|
Loading…
Add table
Add a link
Reference in a new issue