parent
3db84c1247
commit
cdee8c7ffd
2 changed files with 6 additions and 8 deletions
|
|
@ -5,20 +5,20 @@ use gpui::{
|
|||
|
||||
use crate::theme::ActiveTheme as _;
|
||||
|
||||
use super::{DockItemInfo, DockItemState, Panel, PanelEvent};
|
||||
use super::{DockItemState, Panel, PanelEvent};
|
||||
|
||||
pub(crate) struct InvalidPanel {
|
||||
name: SharedString,
|
||||
focus_handle: FocusHandle,
|
||||
info: DockItemInfo,
|
||||
old_state: DockItemState,
|
||||
}
|
||||
|
||||
impl InvalidPanel {
|
||||
pub(crate) fn new(name: &str, info: DockItemInfo, cx: &mut WindowContext) -> Self {
|
||||
pub(crate) fn new(name: &str, state: DockItemState, cx: &mut WindowContext) -> Self {
|
||||
Self {
|
||||
focus_handle: cx.focus_handle(),
|
||||
name: SharedString::from(name.to_owned()),
|
||||
info,
|
||||
old_state: state,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -28,9 +28,7 @@ impl Panel for InvalidPanel {
|
|||
}
|
||||
|
||||
fn dump(&self, _cx: &AppContext) -> super::DockItemState {
|
||||
let mut state = DockItemState::new(self);
|
||||
state.info = self.info.clone();
|
||||
state
|
||||
self.old_state.clone()
|
||||
}
|
||||
}
|
||||
impl EventEmitter<PanelEvent> for InvalidPanel {}
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ impl DockItemState {
|
|||
} else {
|
||||
// Show an invalid panel if the panel is not registered.
|
||||
Box::new(
|
||||
cx.new_view(|cx| InvalidPanel::new(&self.panel_name, info.clone(), cx)),
|
||||
cx.new_view(|cx| InvalidPanel::new(&self.panel_name, self.clone(), cx)),
|
||||
)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue