Remove last stale code
This commit is contained in:
parent
5897b18cfd
commit
bfb59f1598
9 changed files with 2 additions and 253 deletions
|
@ -60,24 +60,6 @@ pub enum SaveIntent {
|
|||
#[derive(Clone, Deserialize, PartialEq, Debug)]
|
||||
pub struct ActivateItem(pub usize);
|
||||
|
||||
// #[derive(Clone, PartialEq)]
|
||||
// pub struct CloseItemById {
|
||||
// pub item_id: usize,
|
||||
// pub pane: WeakView<Pane>,
|
||||
// }
|
||||
|
||||
// #[derive(Clone, PartialEq)]
|
||||
// pub struct CloseItemsToTheLeftById {
|
||||
// pub item_id: usize,
|
||||
// pub pane: WeakView<Pane>,
|
||||
// }
|
||||
|
||||
// #[derive(Clone, PartialEq)]
|
||||
// pub struct CloseItemsToTheRightById {
|
||||
// pub item_id: usize,
|
||||
// pub pane: WeakView<Pane>,
|
||||
// }
|
||||
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, Default)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CloseActiveItem {
|
||||
|
@ -1226,125 +1208,6 @@ impl Pane {
|
|||
cx.emit(Event::Split(direction));
|
||||
}
|
||||
|
||||
// fn deploy_split_menu(&mut self, cx: &mut ViewContext<Self>) {
|
||||
// self.tab_bar_context_menu.handle.update(cx, |menu, cx| {
|
||||
// menu.toggle(
|
||||
// Default::default(),
|
||||
// AnchorCorner::TopRight,
|
||||
// vec![
|
||||
// ContextMenuItem::action("Split Right", SplitRight),
|
||||
// ContextMenuItem::action("Split Left", SplitLeft),
|
||||
// ContextMenuItem::action("Split Up", SplitUp),
|
||||
// ContextMenuItem::action("Split Down", SplitDown),
|
||||
// ],
|
||||
// cx,
|
||||
// );
|
||||
// });
|
||||
|
||||
// self.tab_bar_context_menu.kind = TabBarContextMenuKind::Split;
|
||||
// }
|
||||
|
||||
// fn deploy_new_menu(&mut self, cx: &mut ViewContext<Self>) {
|
||||
// self.tab_bar_context_menu.handle.update(cx, |menu, cx| {
|
||||
// menu.toggle(
|
||||
// Default::default(),
|
||||
// AnchorCorner::TopRight,
|
||||
// vec![
|
||||
// ContextMenuItem::action("New File", NewFile),
|
||||
// ContextMenuItem::action("New Terminal", NewCenterTerminal),
|
||||
// ContextMenuItem::action("New Search", NewSearch),
|
||||
// ],
|
||||
// cx,
|
||||
// );
|
||||
// });
|
||||
|
||||
// self.tab_bar_context_menu.kind = TabBarContextMenuKind::New;
|
||||
// }
|
||||
|
||||
// fn deploy_tab_context_menu(
|
||||
// &mut self,
|
||||
// position: Vector2F,
|
||||
// target_item_id: usize,
|
||||
// cx: &mut ViewContext<Self>,
|
||||
// ) {
|
||||
// let active_item_id = self.items[self.active_item_index].id();
|
||||
// let is_active_item = target_item_id == active_item_id;
|
||||
// let target_pane = cx.weak_handle();
|
||||
|
||||
// // The `CloseInactiveItems` action should really be called "CloseOthers" and the behaviour should be dynamically based on the tab the action is ran on. Currently, this is a weird action because you can run it on a non-active tab and it will close everything by the actual active tab
|
||||
|
||||
// self.tab_context_menu.update(cx, |menu, cx| {
|
||||
// menu.show(
|
||||
// position,
|
||||
// AnchorCorner::TopLeft,
|
||||
// if is_active_item {
|
||||
// vec![
|
||||
// ContextMenuItem::action(
|
||||
// "Close Active Item",
|
||||
// CloseActiveItem { save_intent: None },
|
||||
// ),
|
||||
// ContextMenuItem::action("Close Inactive Items", CloseInactiveItems),
|
||||
// ContextMenuItem::action("Close Clean Items", CloseCleanItems),
|
||||
// ContextMenuItem::action("Close Items To The Left", CloseItemsToTheLeft),
|
||||
// ContextMenuItem::action("Close Items To The Right", CloseItemsToTheRight),
|
||||
// ContextMenuItem::action(
|
||||
// "Close All Items",
|
||||
// CloseAllItems { save_intent: None },
|
||||
// ),
|
||||
// ]
|
||||
// } else {
|
||||
// // In the case of the user right clicking on a non-active tab, for some item-closing commands, we need to provide the id of the tab, for the others, we can reuse the existing command.
|
||||
// vec![
|
||||
// ContextMenuItem::handler("Close Inactive Item", {
|
||||
// let pane = target_pane.clone();
|
||||
// move |cx| {
|
||||
// if let Some(pane) = pane.upgrade(cx) {
|
||||
// pane.update(cx, |pane, cx| {
|
||||
// pane.close_item_by_id(
|
||||
// target_item_id,
|
||||
// SaveIntent::Close,
|
||||
// cx,
|
||||
// )
|
||||
// .detach_and_log_err(cx);
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// }),
|
||||
// ContextMenuItem::action("Close Inactive Items", CloseInactiveItems),
|
||||
// ContextMenuItem::action("Close Clean Items", CloseCleanItems),
|
||||
// ContextMenuItem::handler("Close Items To The Left", {
|
||||
// let pane = target_pane.clone();
|
||||
// move |cx| {
|
||||
// if let Some(pane) = pane.upgrade(cx) {
|
||||
// pane.update(cx, |pane, cx| {
|
||||
// pane.close_items_to_the_left_by_id(target_item_id, cx)
|
||||
// .detach_and_log_err(cx);
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// }),
|
||||
// ContextMenuItem::handler("Close Items To The Right", {
|
||||
// let pane = target_pane.clone();
|
||||
// move |cx| {
|
||||
// if let Some(pane) = pane.upgrade(cx) {
|
||||
// pane.update(cx, |pane, cx| {
|
||||
// pane.close_items_to_the_right_by_id(target_item_id, cx)
|
||||
// .detach_and_log_err(cx);
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// }),
|
||||
// ContextMenuItem::action(
|
||||
// "Close All Items",
|
||||
// CloseAllItems { save_intent: None },
|
||||
// ),
|
||||
// ]
|
||||
// },
|
||||
// cx,
|
||||
// );
|
||||
// });
|
||||
// }
|
||||
|
||||
pub fn toolbar(&self) -> &View<Toolbar> {
|
||||
&self.toolbar
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue