mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 06:05:19 +00:00
Use icons instead of text in toggles
This commit is contained in:
parent
a33d8519f2
commit
b29a535f04
3 changed files with 37 additions and 6 deletions
6
assets/icons/filter_14.svg
Normal file
6
assets/icons/filter_14.svg
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14px" height="14px" viewBox="0 0 14 14" version="1.1">
|
||||
<g id="surface1">
|
||||
<path style="fill:none;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(47.058824%,49.019608%,52.941176%);stroke-opacity:1;stroke-miterlimit:4;" d="M 10.674107 1.40625 C 10.804688 1.242188 10.690848 1.001116 10.479911 1.001116 L 1.520089 1.001116 C 1.309152 1.001116 1.195312 1.242188 1.325893 1.40625 L 4.145089 4.93192 C 4.342634 5.176339 4.446429 5.481027 4.446429 5.795759 C 4.446429 6.46875 4.446429 9.334821 4.446429 10.503348 C 4.446429 10.777902 4.670759 10.998884 4.948661 10.998884 L 7.051339 10.998884 C 7.329241 10.998884 7.550223 10.777902 7.550223 10.503348 C 7.550223 9.334821 7.550223 6.46875 7.550223 5.795759 C 7.550223 5.481027 7.657366 5.176339 7.854911 4.93192 Z M 10.674107 1.40625 " transform="matrix(1.166667,0,0,1.166667,0,0)"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 991 B |
8
assets/icons/word_search_12.svg
Normal file
8
assets/icons/word_search_12.svg
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12px" height="12px" viewBox="0 0 12 12" version="1.1">
|
||||
<g id="surface1">
|
||||
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(47.058824%,49.019608%,52.941176%);fill-opacity:1;" d="M 4.070312 8.132812 L 3.488281 5.171875 L 2.902344 8.132812 L 1.867188 8.132812 L 0.859375 3.433594 L 1.949219 3.433594 L 2.414062 6.359375 L 2.988281 3.445312 L 3.992188 3.445312 L 4.558594 6.351562 L 5.019531 3.433594 L 6.113281 3.433594 L 5.105469 8.132812 Z M 4.070312 8.132812 "/>
|
||||
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(47.058824%,49.019608%,52.941176%);fill-opacity:1;" d="M 7.414062 7.992188 C 7.125 7.828125 6.925781 7.558594 6.8125 7.207031 C 6.699219 6.859375 6.644531 6.378906 6.644531 5.773438 C 6.644531 5.175781 6.695312 4.699219 6.804688 4.359375 C 6.917969 4.007812 7.117188 3.738281 7.40625 3.582031 C 7.6875 3.421875 8.066406 3.351562 8.527344 3.351562 C 8.863281 3.351562 9.140625 3.390625 9.339844 3.484375 C 9.433594 3.527344 9.523438 3.589844 9.601562 3.667969 L 9.601562 1.738281 L 10.636719 1.738281 L 10.636719 8.128906 L 9.601562 8.128906 L 9.601562 7.878906 C 9.507812 7.964844 9.410156 8.03125 9.308594 8.082031 C 9.113281 8.175781 8.855469 8.214844 8.554688 8.214844 C 8.085938 8.214844 7.703125 8.144531 7.417969 7.992188 Z M 9.527344 6.734375 C 9.585938 6.515625 9.621094 6.199219 9.621094 5.773438 C 9.621094 5.355469 9.585938 5.042969 9.527344 4.832031 C 9.46875 4.628906 9.378906 4.507812 9.269531 4.441406 L 9.265625 4.4375 C 9.15625 4.367188 8.976562 4.316406 8.703125 4.316406 C 8.40625 4.316406 8.203125 4.367188 8.078125 4.441406 L 8.074219 4.445312 C 7.953125 4.511719 7.859375 4.632812 7.792969 4.835938 C 7.730469 5.042969 7.695312 5.355469 7.695312 5.773438 C 7.695312 6.199219 7.730469 6.511719 7.792969 6.71875 C 7.859375 6.921875 7.957031 7.050781 8.078125 7.121094 C 8.203125 7.199219 8.40625 7.246094 8.703125 7.246094 C 8.976562 7.246094 9.15625 7.203125 9.265625 7.132812 C 9.375 7.0625 9.46875 6.9375 9.527344 6.734375 Z M 9.527344 6.734375 "/>
|
||||
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(47.058824%,49.019608%,52.941176%);fill-opacity:1;" d="M 1.519531 9.1875 L 10.480469 9.1875 C 10.777344 9.1875 11.023438 9.429688 11.023438 9.730469 C 11.023438 10.03125 10.777344 10.273438 10.480469 10.273438 L 1.519531 10.273438 C 1.222656 10.273438 0.976562 10.03125 0.976562 9.730469 C 0.976562 9.429688 1.222656 9.1875 1.519531 9.1875 Z M 1.519531 9.1875 "/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
|
@ -1164,9 +1164,11 @@ impl ProjectSearchBar {
|
|||
.option_button
|
||||
.in_state(is_active)
|
||||
.style_for(state);
|
||||
Svg::new(icon).with_color(style.text.color.clone())
|
||||
Svg::new(icon)
|
||||
.with_color(style.text.color.clone())
|
||||
.contained()
|
||||
.with_style(style.container)
|
||||
.constrained()
|
||||
})
|
||||
.on_click(MouseButton::Left, move |_, this, cx| {
|
||||
this.toggle_search_option(option, cx);
|
||||
|
@ -1335,7 +1337,7 @@ impl View for ProjectSearchBar {
|
|||
.flex(1.0, true);
|
||||
let regex_button = self.render_option_button("Regex", SearchOptions::REGEX, cx);
|
||||
let row_spacing = theme.workspace.toolbar.container.padding.bottom;
|
||||
let search = _search.read(cx);
|
||||
let search = _search.read(cx);
|
||||
let filter_button = {
|
||||
let tooltip_style = theme::current(cx).tooltip.clone();
|
||||
let is_active = search.filters_enabled;
|
||||
|
@ -1357,8 +1359,15 @@ let search = _search.read(cx);
|
|||
.with_cursor_style(CursorStyle::PointingHand)
|
||||
.with_tooltip::<Self>(0, "Toggle filters".into(), None, tooltip_style, cx)
|
||||
.into_any()
|
||||
}; let search = _search.read(cx);
|
||||
};
|
||||
let search = _search.read(cx);
|
||||
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)
|
||||
.contained().constrained()
|
||||
//.with_margin_right(tab_theme.spacing),
|
||||
)
|
||||
.with_child(
|
||||
ChildView::new(&search.query_editor, cx)
|
||||
.constrained()
|
||||
|
@ -1369,13 +1378,21 @@ let search = _search.read(cx);
|
|||
Flex::row()
|
||||
.with_children([
|
||||
filter_button,
|
||||
self.render_option_button("Case", SearchOptions::CASE_SENSITIVE, cx),
|
||||
self.render_option_button_icon("icons/word_search_14.svg", SearchOptions::WHOLE_WORD, cx),
|
||||
|
||||
self.render_option_button_icon(
|
||||
"icons/word_search_12.svg",
|
||||
SearchOptions::CASE_SENSITIVE,
|
||||
cx,
|
||||
),
|
||||
self.render_option_button_icon(
|
||||
"icons/word_search_12.svg",
|
||||
SearchOptions::WHOLE_WORD,
|
||||
cx,
|
||||
),
|
||||
])
|
||||
.flex(1., true)
|
||||
.contained(),
|
||||
)
|
||||
.align_children_center()
|
||||
.aligned()
|
||||
.left()
|
||||
.flex(1., true);
|
||||
|
|
Loading…
Reference in a new issue