Add a split button to terminal panes (#21251)
Follow-up of https://github.com/zed-industries/zed/pull/21238 <img width="873" alt="image" src="https://github.com/user-attachments/assets/8cf2d8ea-a1df-4a6a-95d6-5867e0ee287d"> Release Notes: - N/A
This commit is contained in:
parent
0c8e5550e7
commit
34ed48e14b
2 changed files with 22 additions and 3 deletions
|
@ -36,8 +36,8 @@ use workspace::{
|
|||
move_item, pane,
|
||||
ui::IconName,
|
||||
ActivateNextPane, ActivatePane, ActivatePaneInDirection, ActivatePreviousPane, DraggedTab,
|
||||
ItemId, NewTerminal, Pane, PaneGroup, SplitDirection, SwapPaneInDirection, ToggleZoom,
|
||||
Workspace,
|
||||
ItemId, NewTerminal, Pane, PaneGroup, SplitDirection, SplitDown, SplitLeft, SplitRight,
|
||||
SplitUp, SwapPaneInDirection, ToggleZoom, Workspace,
|
||||
};
|
||||
|
||||
use anyhow::Result;
|
||||
|
@ -166,6 +166,25 @@ impl TerminalPanel {
|
|||
Some(menu)
|
||||
}),
|
||||
)
|
||||
.child(
|
||||
PopoverMenu::new("terminal-pane-tab-bar-split")
|
||||
.trigger(
|
||||
IconButton::new("terminal-pane-split", IconName::Split)
|
||||
.icon_size(IconSize::Small)
|
||||
.tooltip(|cx| Tooltip::text("Split Pane", cx)),
|
||||
)
|
||||
.anchor(AnchorCorner::TopRight)
|
||||
.with_handle(pane.split_item_context_menu_handle.clone())
|
||||
.menu(move |cx| {
|
||||
ContextMenu::build(cx, |menu, _| {
|
||||
menu.action("Split Right", SplitRight.boxed_clone())
|
||||
.action("Split Left", SplitLeft.boxed_clone())
|
||||
.action("Split Up", SplitUp.boxed_clone())
|
||||
.action("Split Down", SplitDown.boxed_clone())
|
||||
})
|
||||
.into()
|
||||
}),
|
||||
)
|
||||
.child({
|
||||
let zoomed = pane.is_zoomed();
|
||||
IconButton::new("toggle_zoom", IconName::Maximize)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue