Remove the last of the major todos

This commit is contained in:
Mikayla 2024-01-09 16:14:54 -08:00
parent ed263a7b5c
commit 9ce7ef8949
No known key found for this signature in database
17 changed files with 73 additions and 267 deletions

View file

@ -242,87 +242,6 @@ pub struct DraggedTab {
pub is_active: bool,
}
// pub struct DraggedItem {
// pub handle: Box<dyn ItemHandle>,
// pub pane: WeakView<Pane>,
// }
// pub enum ReorderBehavior {
// None,
// MoveAfterActive,
// MoveToIndex(usize),
// }
// #[derive(Debug, Clone, Copy, PartialEq, Eq)]
// enum TabBarContextMenuKind {
// New,
// Split,
// }
// struct TabBarContextMenu {
// kind: TabBarContextMenuKind,
// handle: View<ContextMenu>,
// }
// impl TabBarContextMenu {
// fn handle_if_kind(&self, kind: TabBarContextMenuKind) -> Option<View<ContextMenu>> {
// if self.kind == kind {
// return Some(self.handle.clone());
// }
// None
// }
// }
// #[allow(clippy::too_many_arguments)]
// fn nav_button<A: Action, F: 'static + Fn(&mut Pane, &mut ViewContext<Pane>)>(
// svg_path: &'static str,
// style: theme::Interactive<theme2::IconButton>,
// nav_button_height: f32,
// tooltip_style: TooltipStyle,
// enabled: bool,
// on_click: F,
// tooltip_action: A,
// action_name: &str,
// cx: &mut ViewContext<Pane>,
// ) -> AnyElement<Pane> {
// MouseEventHandler::new::<A, _>(0, cx, |state, _| {
// let style = if enabled {
// style.style_for(state)
// } else {
// style.disabled_style()
// };
// Svg::new(svg_path)
// .with_color(style.color)
// .constrained()
// .with_width(style.icon_width)
// .aligned()
// .contained()
// .with_style(style.container)
// .constrained()
// .with_width(style.button_width)
// .with_height(nav_button_height)
// .aligned()
// .top()
// })
// .with_cursor_style(if enabled {
// CursorStyle::PointingHand
// } else {
// CursorStyle::default()
// })
// .on_click(MouseButton::Left, move |_, toolbar, cx| {
// on_click(toolbar, cx)
// })
// .with_tooltip::<A>(
// 0,
// action_name.to_string(),
// Some(Box::new(tooltip_action)),
// tooltip_style,
// cx,
// )
// .contained()
// .into_any_named("nav button")
// }
impl EventEmitter<Event> for Pane {}
impl Pane {
@ -333,13 +252,6 @@ impl Pane {
can_drop_predicate: Option<Arc<dyn Fn(&dyn Any, &mut WindowContext) -> bool + 'static>>,
cx: &mut ViewContext<Self>,
) -> Self {
// todo!("context menu")
// let pane_view_id = cx.view_id();
// let context_menu = cx.build_view(|cx| ContextMenu::new(pane_view_id, cx));
// context_menu.update(cx, |menu, _| {
// menu.set_position_mode(OverlayPositionMode::Local)
// });
//
let focus_handle = cx.focus_handle();
let subscriptions = vec![
@ -370,11 +282,6 @@ impl Pane {
split_item_menu: None,
tab_bar_scroll_handle: ScrollHandle::new(),
drag_split_direction: None,
// tab_bar_context_menu: TabBarContextMenu {
// kind: TabBarContextMenuKind::New,
// handle: context_menu,
// },
// tab_context_menu: cx.build_view(|_| ContextMenu::new(pane_view_id, cx)),
workspace,
project,
can_drop_predicate,
@ -450,7 +357,6 @@ impl Pane {
}
pub fn has_focus(&self, cx: &WindowContext) -> bool {
// todo!(); // inline this manually
self.focus_handle.contains_focused(cx)
}