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 pane-toolbar-tabbar-ui

Marshall Bowerse0ca7f844a13
diff --cc crates/workspace2/src/pane.rs
index 8c7d860a8ed,ca2c4c2161e..495819f6081
--- a/crates/workspace2/src/pane.rs
+++ b/crates/workspace2/src/pane.rs
@@@ -1545,22 -1531,21 +1548,17 @@@ impl Pane
right_click_menu(ix).trigger(tab).menu(|cx| {
ContextMenu::build(cx, |menu, cx| {
-- menu.action(
- "Close",
- "Close Active Item",
-- CloseActiveItem { save_intent: None }.boxed_clone(),
- cx,
-- )
- .action("Close Others", CloseInactiveItems.boxed_clone(), cx)
- .separator()
- .action("Close Left", CloseItemsToTheLeft.boxed_clone(), cx)
- .action("Close Right", CloseItemsToTheRight.boxed_clone(), cx)
- .separator()
- .action("Close Clean", CloseCleanItems.boxed_clone(), cx)
- .action("Close Inactive Items", CloseInactiveItems.boxed_clone())
- .action("Close Clean Items", CloseCleanItems.boxed_clone())
- .action("Close Items To The Left", CloseItemsToTheLeft.boxed_clone())
-- .action(
- "Close All",
- "Close Items To The Right",
- CloseItemsToTheRight.boxed_clone(),
- )
- .action(
- "Close All Items",
-- CloseAllItems { save_intent: None }.boxed_clone(),
- cx,
-- )
++ menu.action("Close", CloseActiveItem { save_intent: None }.boxed_clone())
++ .action("Close Others", CloseInactiveItems.boxed_clone())
++ .separator()
++ .action("Close Left", CloseItemsToTheLeft.boxed_clone())
++ .action("Close Right", CloseItemsToTheRight.boxed_clone())
++ .separator()
++ .action("Close Clean", CloseCleanItems.boxed_clone())
++ .action(
++ "Close All",
++ CloseAllItems { save_intent: None }.boxed_clone(),
++ )
})
})
}
@@@ -1649,50 -1616,65 +1647,49 @@@
.items_center()
.gap_px()
.child(
- div()
- .bg(gpui::blue())
- .border()
- .border_color(gpui::red())
- .child(IconButton::new("plus", Icon::Plus).on_click(
- cx.listener(|this, _, cx| {
- let menu = ContextMenu::build(cx, |menu, cx| {
- menu.action("New File", NewFile.boxed_clone())
- .action(
- "New Terminal",
- NewCenterTerminal.boxed_clone(),
- )
- .action("New Search", NewSearch.boxed_clone())
- });
- cx.subscribe(
- &menu,
- |this, _, event: &DismissEvent, cx| {
- this.focus(cx);
- this.new_item_menu = None;
- },
- )
- .detach();
- this.new_item_menu = Some(menu);
- }),
- ))
- .when_some(self.new_item_menu.as_ref(), |el, new_item_menu| {
- el.child(Self::render_menu_overlay(new_item_menu))
- }),
+ IconButton::new("plus", Icon::Plus)
+ .icon_size(IconSize::Small)
+ .on_click(cx.listener(|this, _, cx| {
+ let menu = ContextMenu::build(cx, |menu, cx| {
- menu.action("New File", NewFile.boxed_clone(), cx)
++ menu.action("New File", NewFile.boxed_clone())
+ .action(
+ "New Terminal",
+ NewCenterTerminal.boxed_clone(),
- cx,
+ )
- .action("New Search", NewSearch.boxed_clone(), cx)
++ .action("New Search", NewSearch.boxed_clone())
+ });
+ cx.subscribe(&menu, |this, _, event: &DismissEvent, cx| {
+ this.focus(cx);
+ this.new_item_menu = None;
+ })
+ .detach();
+ this.new_item_menu = Some(menu);
+ })),
)
+ .when_some(self.new_item_menu.as_ref(), |el, new_item_menu| {
+ el.child(Self::render_menu_overlay(new_item_menu))
+ })
.child(
- div()
- .border()
- .border_color(gpui::red())
- .child(IconButton::new("split", Icon::Split).on_click(
- cx.listener(|this, _, cx| {
- let menu = ContextMenu::build(cx, |menu, cx| {
- 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())
- });
- cx.subscribe(
- &menu,
- |this, _, event: &DismissEvent, cx| {
- this.focus(cx);
- this.split_item_menu = None;
- },
- )
- .detach();
- this.split_item_menu = Some(menu);
- }),
- ))
- .when_some(
- self.split_item_menu.as_ref(),
- |el, split_item_menu| {
- el.child(Self::render_menu_overlay(split_item_menu))
- },
- ),
- ),
+ IconButton::new("split", Icon::Split)
+ .icon_size(IconSize::Small)
+ .on_click(cx.listener(|this, _, cx| {
+ let menu = ContextMenu::build(cx, |menu, cx| {
- menu.action("Split Right", SplitRight.boxed_clone(), cx)
- .action("Split Left", SplitLeft.boxed_clone(), cx)
- .action("Split Up", SplitUp.boxed_clone(), cx)
- .action("Split Down", SplitDown.boxed_clone(), cx)
++ 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())
+ });
+ cx.subscribe(&menu, |this, _, event: &DismissEvent, cx| {
+ this.focus(cx);
+ this.split_item_menu = None;
+ })
+ .detach();
+ this.split_item_menu = Some(menu);
+ })),
+ )
+ .when_some(self.split_item_menu.as_ref(), |el, split_item_menu| {
+ el.child(Self::render_menu_overlay(split_item_menu))
+ }),
),
)
}