Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add row_height

Piotr Osiewicz799278e2966c
diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs
index a3ae61f0a88..aa30d472439 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 6cdb36acc3c..593e0aeb69d 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<V: View>(
.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<V: View>(
.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 e950845b497..dbcffe0382d 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<Interactive<ContainedText>>,
pub nav_button: Interactive<ContainedLabel>,
+ 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 252e759a6d6..c8e347a57d1 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,
}
}