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.

Merge branch 'main' into zed2-breadcrumbs

Julia6f9e08ceea08
diff --cc crates/workspace2/src/pane.rs
index 8f30d0573fc,f16a4fcf09e..e4ef1b1545b
--- a/crates/workspace2/src/pane.rs
+++ b/crates/workspace2/src/pane.rs
@@@ -26,8 -25,8 +26,8 @@@ use std::
},
};
- use ui::{menu_handle, prelude::*, Color, Icon, IconButton, IconElement, Tooltip};
-use ui::v_stack;
-use ui::{prelude::*, Color, Icon, IconButton, IconElement, Tooltip};
++use ui::{prelude::*, right_click_menu, Color, Icon, IconButton, IconElement, Tooltip};
+use ui::{v_stack, ContextMenu};
use util::truncate_and_remove_front;
#[derive(PartialEq, Clone, Copy, Deserialize, Debug)]
@@@ -1522,34 -1477,7 +1522,34 @@@ impl Pane
.children((!close_right).then(|| close_icon()))
.child(label)
.children(close_right.then(|| close_icon())),
- )
+ );
+
- menu_handle(ix).child(|_| tab).menu(|cx| {
++ right_click_menu(ix).trigger(tab).menu(|cx| {
+ ContextMenu::build(cx, |menu, cx| {
+ menu.action(
+ "Close Active Item",
+ CloseActiveItem { save_intent: None }.boxed_clone(),
+ cx,
+ )
+ .action("Close Inactive Items", CloseInactiveItems.boxed_clone(), cx)
+ .action("Close Clean Items", CloseCleanItems.boxed_clone(), cx)
+ .action(
+ "Close Items To The Left",
+ CloseItemsToTheLeft.boxed_clone(),
+ cx,
+ )
+ .action(
+ "Close Items To The Right",
+ CloseItemsToTheRight.boxed_clone(),
+ cx,
+ )
+ .action(
+ "Close All Items",
+ CloseAllItems { save_intent: None }.boxed_clone(),
+ cx,
+ )
+ })
+ })
}
fn render_tab_bar(&mut self, cx: &mut ViewContext<'_, Pane>) -> impl IntoElement {