Start on assistant::QuoteSelection
This commit is contained in:
parent
dc365472a6
commit
69e8a166e4
4 changed files with 101 additions and 3 deletions
|
@ -184,6 +184,12 @@ impl Dock {
|
|||
.map_or(false, |panel| panel.has_focus(cx))
|
||||
}
|
||||
|
||||
pub fn panel<T: Panel>(&self) -> Option<ViewHandle<T>> {
|
||||
self.panel_entries
|
||||
.iter()
|
||||
.find_map(|entry| entry.panel.as_any().clone().downcast())
|
||||
}
|
||||
|
||||
pub fn panel_index_for_type<T: Panel>(&self) -> Option<usize> {
|
||||
self.panel_entries
|
||||
.iter()
|
||||
|
|
|
@ -1678,6 +1678,16 @@ impl Workspace {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn panel<T: Panel>(&self, cx: &WindowContext) -> Option<ViewHandle<T>> {
|
||||
for dock in [&self.left_dock, &self.bottom_dock, &self.right_dock] {
|
||||
let dock = dock.read(cx);
|
||||
if let Some(panel) = dock.panel::<T>() {
|
||||
return Some(panel);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn zoom_out(&mut self, cx: &mut ViewContext<Self>) {
|
||||
for pane in &self.panes {
|
||||
pane.update(cx, |pane, cx| pane.set_zoomed(false, cx));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue