More compilation fixes

This commit is contained in:
Kirill Bulatov
2023-11-16 10:04:18 +02:00
parent 61d6cb880c
commit a238368296
6 changed files with 244 additions and 205 deletions
+12 -12
View File
@@ -179,7 +179,7 @@ pub struct Pane {
workspace: WeakView<Workspace>,
project: Model<Project>,
// can_drop: Rc<dyn Fn(&DragAndDrop<Workspace>, &WindowContext) -> bool>,
// can_split: bool,
can_split: bool,
// render_tab_bar_buttons: Rc<dyn Fn(&mut Pane, &mut ViewContext<Pane>) -> AnyElement<Pane>>,
}
@@ -347,7 +347,7 @@ impl Pane {
workspace,
project,
// can_drop: Rc::new(|_, _| true),
// can_split: true,
can_split: true,
// render_tab_bar_buttons: Rc::new(move |pane, cx| {
// Flex::row()
// // New menu
@@ -427,17 +427,17 @@ impl Pane {
// self.can_drop = Rc::new(can_drop);
// }
// pub fn set_can_split(&mut self, can_split: bool, cx: &mut ViewContext<Self>) {
// self.can_split = can_split;
// cx.notify();
// }
pub fn set_can_split(&mut self, can_split: bool, cx: &mut ViewContext<Self>) {
self.can_split = can_split;
cx.notify();
}
// pub fn set_can_navigate(&mut self, can_navigate: bool, cx: &mut ViewContext<Self>) {
// self.toolbar.update(cx, |toolbar, cx| {
// toolbar.set_can_navigate(can_navigate, cx);
// });
// cx.notify();
// }
pub fn set_can_navigate(&mut self, can_navigate: bool, cx: &mut ViewContext<Self>) {
self.toolbar.update(cx, |toolbar, cx| {
toolbar.set_can_navigate(can_navigate, cx);
});
cx.notify();
}
// pub fn set_render_tab_bar_buttons<F>(&mut self, cx: &mut ViewContext<Self>, render: F)
// where
+10 -9
View File
@@ -36,11 +36,12 @@ use futures::{
Future, FutureExt, StreamExt,
};
use gpui::{
actions, div, point, prelude::*, size, Action, AnyModel, AnyView, AnyWeakView, AppContext,
actions, div, point, register_action, size, Action, AnyModel, AnyView, AnyWeakView, AppContext,
AsyncAppContext, AsyncWindowContext, Bounds, Div, Entity, EntityId, EventEmitter, FocusHandle,
FocusableView, GlobalPixels, KeyContext, Model, ModelContext, ParentComponent, Point, Render,
Size, Styled, Subscription, Task, View, ViewContext, WeakView, WindowBounds, WindowContext,
WindowHandle, WindowOptions,
FocusableView, GlobalPixels, KeyContext, Model, ModelContext, ParentElement, Point, Render,
Size, StatefulInteractive, StatelessInteractive, StatelessInteractivity, Styled, Subscription,
Task, View, ViewContext, VisualContext, WeakView, WindowBounds, WindowContext, WindowHandle,
WindowOptions,
};
use item::{FollowableItem, FollowableItemHandle, Item, ItemHandle, ItemSettings, ProjectItem};
use itertools::Itertools;
@@ -193,10 +194,11 @@ impl Clone for Toast {
}
}
// #[derive(Clone, Deserialize, PartialEq)]
// pub struct OpenTerminal {
// pub working_directory: PathBuf,
// }
#[register_action]
#[derive(Debug, Default, Clone, Deserialize, PartialEq)]
pub struct OpenTerminal {
pub working_directory: PathBuf,
}
// impl_actions!(
// workspace,
@@ -206,7 +208,6 @@ impl Clone for Toast {
// SwapPaneInDirection,
// NewFileInDirection,
// Toast,
// OpenTerminal,
// SaveAll,
// Save,
// CloseAllItemsAndPanes,