Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add styles to git menu
Piotr Osiewiczb699e5c142f9
diff --git a/crates/collab_ui/src/branch_list.rs b/crates/collab_ui/src/branch_list.rsindex 038180b6716..95e418e67ff 100644--- a/crates/collab_ui/src/branch_list.rs+++ b/crates/collab_ui/src/branch_list.rs@@ -2,7 +2,7 @@ use anyhow::{anyhow, bail};use fuzzy::{StringMatch, StringMatchCandidate};use gpui::{elements::*, AppContext, MouseState, Task, ViewContext, ViewHandle};use picker::{Picker, PickerDelegate, PickerEvent};-use std::sync::Arc;+use std::{ops::Not, sync::Arc};use util::ResultExt;use workspace::{Toast, Workspace};@@ -212,7 +212,7 @@ impl PickerDelegate for BranchListDelegate {}fn render_header(&self, cx: &AppContext) -> Option<AnyElement<Picker<Self>>> {let theme = &theme::current(cx);- let style = theme.picker.no_matches.label.clone();+ let style = theme.picker.header.clone();if self.last_query.is_empty() {Some(Flex::row()@@ -221,28 +221,24 @@ impl PickerDelegate for BranchListDelegate {)} else {Some(- Flex::row()- .with_child(Label::new("Branches", style))- .into_any(),- )- }- }- fn render_footer(&self, cx: &AppContext) -> Option<AnyElement<Picker<Self>>> {- if !self.last_query.is_empty() && !self.matches.is_empty() {- let theme = &theme::current(cx);- let style = theme.picker.no_matches.label.clone();- // Render "1 match" and "0 matches", "42 matches"etc.- let suffix = if self.matches.len() == 1 { "" } else { "es" };- Some(- Flex::row()- .with_child(Label::new(- format!("{} match{}", self.matches.len(), suffix),- style,- ))+ Stack::new()+ .with_child(+ Flex::row()+ .with_child(Label::new("Branches", style.clone()).aligned().left()),+ )+ .with_children(self.matches.is_empty().not().then(|| {+ let suffix = if self.matches.len() == 1 { "" } else { "es" };+ Flex::row()+ .align_children_center()+ .with_child(Label::new(+ format!("{} match{}", self.matches.len(), suffix),+ style,+ ))+ .aligned()+ .right()+ })).into_any(),)- } else {- None}}}diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rsindex e54dcdfd1e9..687547a3066 100644--- a/crates/theme/src/theme.rs+++ b/crates/theme/src/theme.rs@@ -585,6 +585,8 @@ pub struct Picker {pub empty_input_editor: FieldEditor,pub no_matches: ContainedLabel,pub item: Toggleable<Interactive<ContainedLabel>>,+ pub header: LabelStyle,+ pub footer: LabelStyle,}#[derive(Clone, Debug, Deserialize, Default, JsonSchema)]diff --git a/styles/src/style_tree/contact_finder.ts b/styles/src/style_tree/contact_finder.tsindex e61d100264b..4815a4e98e5 100644--- a/styles/src/style_tree/contact_finder.ts+++ b/styles/src/style_tree/contact_finder.ts@@ -44,6 +44,8 @@ export default function contact_finder(theme: ColorScheme): any {no_matches: picker_style.no_matches,input_editor: picker_input,empty_input_editor: picker_input,+ header: picker_style.header,+ footer: picker_style.footer,},row_height: 28,contact_avatar: {diff --git a/styles/src/style_tree/picker.ts b/styles/src/style_tree/picker.tsindex 7ca76cd85f3..9918d1a2d66 100644--- a/styles/src/style_tree/picker.ts+++ b/styles/src/style_tree/picker.ts@@ -108,5 +108,34 @@ export default function picker(theme: ColorScheme): any {top: 8,},},+ header: {+ text: text(theme.lowest, "sans", "variant", { size: "xs" }),+ padding: {+ bottom: 4,+ left: 12,+ right: 12,+ top: 4,+ },+ margin: {+ top: 1,+ left: 4,+ right: 4,+ },+ },+ footer: {+ text: text(theme.lowest, "sans", "variant", { size: "xs" }),+ padding: {+ bottom: 4,+ left: 12,+ right: 12,+ top: 4,+ },+ margin: {+ top: 1,+ left: 4,+ right: 4,+ },++ }}}