added svg right margin in search bar

KCaverly and Piotr created

Co-authored-by: Piotr <piotr@zed.dev>

Change summary

crates/search/src/project_search.rs | 13 +++++++------
crates/theme/src/theme.rs           |  1 +
styles/src/style_tree/search.ts     | 15 ++++++++++++++-
3 files changed, 22 insertions(+), 7 deletions(-)

Detailed changes

crates/search/src/project_search.rs 🔗

@@ -1230,7 +1230,7 @@ impl ProjectSearchBar {
         cx: &mut ViewContext<Self>,
     ) -> AnyElement<Self> {
         let tooltip_style = theme::current(cx).tooltip.clone();
-        let is_active = current_mode == SearchMode::Regex;
+        let is_active = current_mode == SearchMode::Regex; //self.is_option_enabled(option, cx);
         let option = SearchOptions::REGEX;
         MouseEventHandler::<Self, _>::new(option.bits as usize, cx, |state, cx| {
             let theme = theme::current(cx);
@@ -1405,7 +1405,7 @@ impl View for ProjectSearchBar {
 
             let case_sensitive = if is_semantic_disabled {
                 Some(self.render_option_button_icon(
-                    "icons/case_insensitive_14.svg",
+                    "icons/case_insensitive_12.svg",
                     SearchOptions::CASE_SENSITIVE,
                     cx,
                 ))
@@ -1424,13 +1424,14 @@ impl View for ProjectSearchBar {
             };
 
             let search = _search.read(cx);
+            let icon_style = theme.search.editor_icon.clone();
+            // "
             let query = Flex::row()
                 .with_child(
-                    Svg::new("icons/magnifying_glass_12.svg")
-                        .with_color(gpui::color::Color::white())
-                        //.with_color(tab_theme.label.text.color)
+                    Svg::for_style(icon_style.icon)
                         .contained()
-                        .constrained(), //.with_margin_right(tab_theme.spacing),
+                        .with_style(icon_style.container)
+                        .constrained(),
                 )
                 .with_child(
                     ChildView::new(&search.query_editor, cx)

crates/theme/src/theme.rs 🔗

@@ -385,6 +385,7 @@ pub struct Search {
     pub match_index: ContainedText,
     pub results_status: TextStyle,
     pub dismiss_button: Interactive<IconButton>,
+    pub editor_icon: IconStyle,
 }
 
 #[derive(Clone, Deserialize, Default, JsonSchema)]

styles/src/style_tree/search.ts 🔗

@@ -54,7 +54,7 @@ export default function search(): any {
                         left: 6,
                         right: 6,
                         top: 6,
-                },
+                    },
                 },
                 state: {
                     hovered: {
@@ -163,5 +163,18 @@ export default function search(): any {
                 },
             },
         }),
+        editor_icon: {
+            icon: {
+                color: foreground(theme.highest, "variant"),
+                asset: "icons/magnifying_glass_12.svg",
+                dimensions: {
+                    width: 12,
+                    height: 12,
+                }
+            },
+            container: {
+                padding: { right: 6 }
+            }
+        }
     }
 }