Extract {Container,Label}Style structs from those elements
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
200e278bc9
commit
fa01273466
+10
-12
@@ -154,6 +154,12 @@ impl FileFinder {
|
||||
|(file_name, file_name_positions, full_path, full_path_positions)| {
|
||||
let bold = *Properties::new().weight(Weight::BOLD);
|
||||
let selected_index = self.selected_index();
|
||||
let label_style = LabelStyle {
|
||||
default_color: theme.modal_match_text.0,
|
||||
highlight_color: theme.modal_match_text_highlight.0,
|
||||
highlight_font_properties: bold,
|
||||
..Default::default()
|
||||
};
|
||||
let mut container = Container::new(
|
||||
Flex::row()
|
||||
.with_child(
|
||||
@@ -178,12 +184,8 @@ impl FileFinder {
|
||||
settings.ui_font_family,
|
||||
settings.ui_font_size,
|
||||
)
|
||||
.with_default_color(theme.modal_match_text.0)
|
||||
.with_highlights(
|
||||
theme.modal_match_text_highlight.0,
|
||||
bold,
|
||||
file_name_positions,
|
||||
)
|
||||
.with_style(&label_style)
|
||||
.with_highlights(file_name_positions)
|
||||
.boxed(),
|
||||
)
|
||||
.with_child(
|
||||
@@ -192,12 +194,8 @@ impl FileFinder {
|
||||
settings.ui_font_family,
|
||||
settings.ui_font_size,
|
||||
)
|
||||
.with_default_color(theme.modal_match_text.0)
|
||||
.with_highlights(
|
||||
theme.modal_match_text_highlight.0,
|
||||
bold,
|
||||
full_path_positions,
|
||||
)
|
||||
.with_style(&label_style)
|
||||
.with_highlights(full_path_positions)
|
||||
.boxed(),
|
||||
)
|
||||
.boxed(),
|
||||
|
||||
@@ -11,8 +11,8 @@ use futures::lock::Mutex;
|
||||
use gpui::{
|
||||
color::ColorF,
|
||||
elements::{
|
||||
Align, ChildView, ConstrainedBox, Container, Expanded, Flex, Label, ParentElement,
|
||||
UniformList, UniformListState,
|
||||
Align, ChildView, ConstrainedBox, Container, Expanded, Flex, Label, LabelStyle,
|
||||
ParentElement, UniformList, UniformListState,
|
||||
},
|
||||
fonts::{Properties, Weight},
|
||||
geometry::vector::vec2f,
|
||||
@@ -233,7 +233,6 @@ impl ThemeSelector {
|
||||
fn render_match(&self, theme_match: &StringMatch, index: usize) -> ElementBox {
|
||||
let settings = self.settings.borrow();
|
||||
let theme = &settings.theme.ui;
|
||||
let bold = *Properties::new().weight(Weight::BOLD);
|
||||
|
||||
let mut container = Container::new(
|
||||
Label::new(
|
||||
@@ -241,12 +240,13 @@ impl ThemeSelector {
|
||||
settings.ui_font_family,
|
||||
settings.ui_font_size,
|
||||
)
|
||||
.with_default_color(theme.modal_match_text.0)
|
||||
.with_highlights(
|
||||
theme.modal_match_text_highlight.0,
|
||||
bold,
|
||||
theme_match.positions.clone(),
|
||||
)
|
||||
.with_style(&LabelStyle {
|
||||
default_color: theme.modal_match_text.0,
|
||||
highlight_color: theme.modal_match_text_highlight.0,
|
||||
highlight_font_properties: *Properties::new().weight(Weight::BOLD),
|
||||
..Default::default()
|
||||
})
|
||||
.with_highlights(theme_match.positions.clone())
|
||||
.boxed(),
|
||||
)
|
||||
.with_uniform_padding(6.0)
|
||||
|
||||
Reference in New Issue
Block a user