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.

Show Zoom In/Out shortcuts in the labels (#10604)

Kirill Bulatov263023021d80
diff --git a/crates/terminal_view/src/terminal_panel.rs b/crates/terminal_view/src/terminal_panel.rs
index d96eefba006..83cc9efa1f7 100644
--- a/crates/terminal_view/src/terminal_panel.rs
+++ b/crates/terminal_view/src/terminal_panel.rs
@@ -26,7 +26,7 @@ use workspace::{
item::Item,
pane,
ui::IconName,
- DraggedTab, NewTerminal, Pane, Workspace,
+ DraggedTab, NewTerminal, Pane, ToggleZoom, Workspace,
};
use anyhow::Result;
@@ -98,8 +98,13 @@ impl TerminalPanel {
.on_click(cx.listener(|pane, _, cx| {
pane.toggle_zoom(&workspace::ToggleZoom, cx);
}))
+ // TODO kb
.tooltip(move |cx| {
- Tooltip::text(if zoomed { "Zoom Out" } else { "Zoom In" }, cx)
+ Tooltip::for_action(
+ if zoomed { "Zoom Out" } else { "Zoom In" },
+ &ToggleZoom,
+ cx,
+ )
})
})
.into_any_element()
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs
index 6bfd16e528f..c8658699ca6 100644
--- a/crates/workspace/src/pane.rs
+++ b/crates/workspace/src/pane.rs
@@ -365,7 +365,11 @@ impl Pane {
pane.toggle_zoom(&crate::ToggleZoom, cx);
}))
.tooltip(move |cx| {
- Tooltip::text(if zoomed { "Zoom Out" } else { "Zoom In" }, cx)
+ Tooltip::for_action(
+ if zoomed { "Zoom Out" } else { "Zoom In" },
+ &ToggleZoom,
+ cx,
+ )
})
})
.when_some(pane.split_item_menu.as_ref(), |el, split_item_menu| {