From 799278e2966c50711fd76dc2def85abaac2790d2 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Fri, 11 Aug 2023 17:02:25 +0200 Subject: [PATCH] Add row_height --- crates/search/src/project_search.rs | 4 +++- crates/search/src/search_bar.rs | 4 ++-- crates/theme/src/theme.rs | 1 + styles/src/style_tree/search.ts | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index a3ae61f0a8..aa30d47243 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -1592,7 +1592,8 @@ impl View for ProjectSearchBar { .top() .left(), ) - .contained() + .constrained() + .with_max_height(theme.search.search_bar_row_height) .flex(1., true), ) .with_child( @@ -1609,6 +1610,7 @@ impl View for ProjectSearchBar { .constrained() .with_min_width(theme.search.editor.min_width) .with_max_width(theme.search.editor.max_width) + .with_max_height(theme.search.search_bar_row_height) .flex(1., false), ) .contained() diff --git a/crates/search/src/search_bar.rs b/crates/search/src/search_bar.rs index 6cdb36acc3..593e0aeb69 100644 --- a/crates/search/src/search_bar.rs +++ b/crates/search/src/search_bar.rs @@ -163,7 +163,7 @@ pub(crate) fn render_search_mode_button( .contained() .constrained() .with_max_width(side_width) - .with_height(32.), + .with_height(theme.search.search_bar_row_height), ) .with_child(label) .into_any() @@ -183,7 +183,7 @@ pub(crate) fn render_search_mode_button( .contained() .constrained() .with_max_width(side_width) - .with_height(32.), + .with_height(theme.search.search_bar_row_height), ) .into_any() } diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index e950845b49..dbcffe0382 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -389,6 +389,7 @@ pub struct Search { pub editor_icon: IconStyle, pub mode_button: Toggleable>, pub nav_button: Interactive, + pub search_bar_row_height: f32, } #[derive(Clone, Deserialize, Default, JsonSchema)] diff --git a/styles/src/style_tree/search.ts b/styles/src/style_tree/search.ts index 252e759a6d..c8e347a57d 100644 --- a/styles/src/style_tree/search.ts +++ b/styles/src/style_tree/search.ts @@ -272,6 +272,7 @@ export default function search(): any { }, }, }), + search_bar_row_height: 32, } }