Style search in buffer below breadcrumbs
We still have issues with project search styling. Co-Authored-By: Antonio Scandurra <me@as-cii.com> Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
8bfac63e0d
commit
903810f22e
6 changed files with 30 additions and 15 deletions
|
@ -75,6 +75,8 @@ impl View for Breadcrumbs {
|
||||||
.boxed(),
|
.boxed(),
|
||||||
]
|
]
|
||||||
}))
|
}))
|
||||||
|
.contained()
|
||||||
|
.with_style(theme.breadcrumbs.container)
|
||||||
.boxed()
|
.boxed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,10 @@ impl Color {
|
||||||
Self(ColorU::from_u32(0x0000ffff))
|
Self(ColorU::from_u32(0x0000ffff))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn yellow() -> Self {
|
||||||
|
Self(ColorU::from_u32(0x00ffffff))
|
||||||
|
}
|
||||||
|
|
||||||
pub fn new(r: u8, g: u8, b: u8, a: u8) -> Self {
|
pub fn new(r: u8, g: u8, b: u8, a: u8) -> Self {
|
||||||
Self(ColorU::new(r, g, b, a))
|
Self(ColorU::new(r, g, b, a))
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,13 @@ impl View for BufferSearchBar {
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_child(
|
.with_child(
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_child(ChildView::new(&self.query_editor).flex(1., true).boxed())
|
.with_child(
|
||||||
|
ChildView::new(&self.query_editor)
|
||||||
|
.aligned()
|
||||||
|
.left()
|
||||||
|
.flex(1., true)
|
||||||
|
.boxed(),
|
||||||
|
)
|
||||||
.with_children(self.active_editor.as_ref().and_then(|editor| {
|
.with_children(self.active_editor.as_ref().and_then(|editor| {
|
||||||
let matches = self.editors_with_matches.get(&editor.downgrade())?;
|
let matches = self.editors_with_matches.get(&editor.downgrade())?;
|
||||||
let message = if let Some(match_ix) = self.active_match_index {
|
let message = if let Some(match_ix) = self.active_match_index {
|
||||||
|
@ -104,7 +110,9 @@ impl View for BufferSearchBar {
|
||||||
.with_style(editor_container)
|
.with_style(editor_container)
|
||||||
.aligned()
|
.aligned()
|
||||||
.constrained()
|
.constrained()
|
||||||
|
.with_min_width(theme.search.editor.min_width)
|
||||||
.with_max_width(theme.search.editor.max_width)
|
.with_max_width(theme.search.editor.max_width)
|
||||||
|
.flex(1., false)
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
.with_child(
|
.with_child(
|
||||||
|
@ -124,6 +132,8 @@ impl View for BufferSearchBar {
|
||||||
.aligned()
|
.aligned()
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
|
.contained()
|
||||||
|
.with_style(theme.search.container)
|
||||||
.named("search bar")
|
.named("search bar")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub struct Theme {
|
||||||
pub editor: Editor,
|
pub editor: Editor,
|
||||||
pub search: Search,
|
pub search: Search,
|
||||||
pub project_diagnostics: ProjectDiagnostics,
|
pub project_diagnostics: ProjectDiagnostics,
|
||||||
pub breadcrumbs: Breadcrumbs,
|
pub breadcrumbs: ContainedText,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Default)]
|
#[derive(Deserialize, Default)]
|
||||||
|
@ -123,6 +123,7 @@ pub struct Search {
|
||||||
pub struct FindEditor {
|
pub struct FindEditor {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub input: FieldEditor,
|
pub input: FieldEditor,
|
||||||
|
pub min_width: f32,
|
||||||
pub max_width: f32,
|
pub max_width: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,11 +279,6 @@ pub struct ProjectDiagnostics {
|
||||||
pub tab_summary_spacing: f32,
|
pub tab_summary_spacing: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Deserialize, Default)]
|
|
||||||
pub struct Breadcrumbs {
|
|
||||||
pub text: TextStyle,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Deserialize, Default)]
|
#[derive(Clone, Deserialize, Default)]
|
||||||
pub struct Editor {
|
pub struct Editor {
|
||||||
pub text_color: Color,
|
pub text_color: Color,
|
||||||
|
|
|
@ -127,7 +127,7 @@ impl Toolbar {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
self.items.push((Box::new(item), dbg!(location)));
|
self.items.push((Box::new(item), location));
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,13 +87,15 @@ lsp_message = "$text.2"
|
||||||
[workspace.toolbar]
|
[workspace.toolbar]
|
||||||
background = "$surface.1"
|
background = "$surface.1"
|
||||||
border = { color = "$border.0", width = 1, left = false, right = false, bottom = true, top = false }
|
border = { color = "$border.0", width = 1, left = false, right = false, bottom = true, top = false }
|
||||||
height = 44
|
height = 34
|
||||||
item_spacing = 8
|
item_spacing = 8
|
||||||
padding.left = 8
|
padding.left = 16
|
||||||
padding.right = 8
|
padding.right = 8
|
||||||
|
padding.bottom = 4
|
||||||
|
|
||||||
[breadcrumbs]
|
[breadcrumbs]
|
||||||
text = "$text.1"
|
extends = "$text.1"
|
||||||
|
padding = { left = 6 }
|
||||||
|
|
||||||
[panel]
|
[panel]
|
||||||
padding = { top = 12, left = 12, bottom = 12, right = 12 }
|
padding = { top = 12, left = 12, bottom = 12, right = 12 }
|
||||||
|
@ -395,15 +397,16 @@ extends = "$text.2"
|
||||||
padding = 6
|
padding = 6
|
||||||
|
|
||||||
[search.editor]
|
[search.editor]
|
||||||
max_width = 250
|
min_width = 200
|
||||||
|
max_width = 500
|
||||||
background = "$surface.0"
|
background = "$surface.0"
|
||||||
corner_radius = 6
|
corner_radius = 6
|
||||||
padding = { left = 13, right = 13, top = 3, bottom = 3 }
|
padding = { left = 14, right = 14, top = 3, bottom = 3 }
|
||||||
margin = { top = 5, bottom = 5, left = 5, right = 5 }
|
margin = { right = 5 }
|
||||||
text = "$text.0"
|
text = "$text.0"
|
||||||
placeholder_text = "$text.2"
|
placeholder_text = "$text.2"
|
||||||
selection = "$selection.host"
|
selection = "$selection.host"
|
||||||
border = { width = 1, color = "$border.0" }
|
border = { width = 1, color = "$border.0", overlay = true }
|
||||||
|
|
||||||
[search.invalid_editor]
|
[search.invalid_editor]
|
||||||
extends = "$search.editor"
|
extends = "$search.editor"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue