From 46006a3c81aca258f0962a7b48ca9fa4b3ec8361 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:00:32 -0300 Subject: [PATCH] Add new pin and unpin icons (#17445) This PR adds new SVGs for the pin and unpin icons, using a custom-made one in a smaller size, and thus removing the `PinAlt` one I added just recently. I also tweak the outline panel pin icon button tooltip strings a bit. Release Notes: - N/A --- assets/icons/pin.svg | 5 ++++- assets/icons/unpin.svg | 5 ++++- crates/outline_panel/src/outline_panel.rs | 11 +++++++++-- crates/ui/src/components/icon.rs | 2 -- crates/workspace/src/pane.rs | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/assets/icons/pin.svg b/assets/icons/pin.svg index 75798fd29fce953c276d33f26a802f178d52cd59..f3f50cc65953d2dc3b3ce038da708de213c6058a 100644 --- a/assets/icons/pin.svg +++ b/assets/icons/pin.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/assets/icons/unpin.svg b/assets/icons/unpin.svg index 382ed70b3358f515d0c61943a65262995f397f14..07c93eae6fc34102227dae619f0f6b5341874ac7 100644 --- a/assets/icons/unpin.svg +++ b/assets/icons/unpin.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rs index 6605426d5976b5f25edd31b370d5d064e2228ea3..8d395bda02d7b8dac4eda4a8b66460f077c4fca8 100644 --- a/crates/outline_panel/src/outline_panel.rs +++ b/crates/outline_panel/src/outline_panel.rs @@ -4056,7 +4056,7 @@ impl Render for OutlinePanel { .child( v_flex().child(horizontal_separator(cx)).child( h_flex().p_2().child(self.filter_editor.clone()).child( - div().border_1().child( + div().child( IconButton::new( "outline-panel-menu", if pinned { @@ -4066,7 +4066,14 @@ impl Render for OutlinePanel { }, ) .tooltip(move |cx| { - Tooltip::text(if pinned { "Unpin" } else { "Pin active editor" }, cx) + Tooltip::text( + if pinned { + "Unpin Outline" + } else { + "Pin Active Outline" + }, + cx, + ) }) .shape(IconButtonShape::Square) .on_click(cx.listener(|outline_panel, _, cx| { diff --git a/crates/ui/src/components/icon.rs b/crates/ui/src/components/icon.rs index e48583f6dd97e03a10b86515791eb5f18c79bee2..0001ab4a2b275b8ae9236e21a3dbe612d1ea6c8c 100644 --- a/crates/ui/src/components/icon.rs +++ b/crates/ui/src/components/icon.rs @@ -213,7 +213,6 @@ pub enum IconName { Pencil, Person, Pin, - PinAlt, Play, Plus, PocketKnife, @@ -386,7 +385,6 @@ impl IconName { IconName::Pencil => "icons/pencil.svg", IconName::Person => "icons/person.svg", IconName::Pin => "icons/pin.svg", - IconName::PinAlt => "icons/pin_alt.svg", IconName::Play => "icons/play.svg", IconName::Plus => "icons/plus.svg", IconName::PocketKnife => "icons/pocket_knife.svg", diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index 2927d1c2ce9edba6dfcc60b12476c86e7cf8be7f..3da15762b79f37f9f071be3125e76184de66fd1c 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -1906,7 +1906,7 @@ impl Pane { .start_slot::(indicator) .map(|this| { let end_slot = if is_pinned { - IconButton::new("unpin tab", IconName::PinAlt) + IconButton::new("unpin tab", IconName::Pin) .shape(IconButtonShape::Square) .icon_color(Color::Muted) .size(ButtonSize::None)