From f4121b42da9dd6d2c72a4e5bc920a6337d9eeb41 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:01:01 +0200 Subject: [PATCH] Add more padding to dismiss button. Add a style for mode buttons group margin Co-authored-by: Kyle --- crates/search/src/buffer_search.rs | 2 +- crates/search/src/project_search.rs | 4 +++- crates/theme/src/theme.rs | 1 + styles/src/style_tree/search.ts | 13 +++++++++---- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/crates/search/src/buffer_search.rs b/crates/search/src/buffer_search.rs index d77f8ac51c..408c696a91 100644 --- a/crates/search/src/buffer_search.rs +++ b/crates/search/src/buffer_search.rs @@ -308,7 +308,7 @@ impl View for BufferSearchBar { .aligned() .left() .contained() - .with_margin_right(3.), + .with_style(theme.search.modes_container), ) .with_child( super::search_bar::render_close_button( diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index de0c424e7b..4e265a8c65 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -1617,10 +1617,12 @@ impl View for ProjectSearchBar { .with_child(search_button_for_mode(SearchMode::Text, cx)) .with_children(semantic_index) .with_child(search_button_for_mode(SearchMode::Regex, cx)) + .constrained() + .with_height(theme.search.search_bar_row_height) .aligned() .left() .contained() - .with_margin_right(3.), + .with_style(theme.search.modes_container), ) .with_child( super::search_bar::render_close_button( diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index 100b2c676b..91d7eeb5dc 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -391,6 +391,7 @@ pub struct Search { pub nav_button: Toggleable>, pub search_bar_row_height: f32, pub option_button_height: f32, + pub modes_container: ContainerStyle, } #[derive(Clone, Deserialize, Default, JsonSchema)] diff --git a/styles/src/style_tree/search.ts b/styles/src/style_tree/search.ts index 7d9600771d..76452ddec3 100644 --- a/styles/src/style_tree/search.ts +++ b/styles/src/style_tree/search.ts @@ -165,10 +165,10 @@ export default function search(): any { button_width: 32, corner_radius: 6, padding: { - top: 8, - bottom: 8, - left: 8, - right: 8, + top: 10, + bottom: 10, + left: 10, + right: 10, }, background: background(theme.highest, "variant"), @@ -309,6 +309,11 @@ export default function search(): any { }), search_bar_row_height: 32, option_button_height: 22, + modes_container: { + margin: { + right: 9 + } + } } }