formatting fixes
This commit is contained in:
parent
853acccbc2
commit
5aad1ff788
3 changed files with 12 additions and 6 deletions
|
@ -76,7 +76,8 @@ impl View for FileFinder {
|
||||||
Container::new(
|
Container::new(
|
||||||
Flex::new(Axis::Vertical)
|
Flex::new(Axis::Vertical)
|
||||||
.with_child(
|
.with_child(
|
||||||
ChildView::new(&self.query_editor).contained()
|
ChildView::new(&self.query_editor)
|
||||||
|
.contained()
|
||||||
.with_style(settings.theme.selector.input_editor.container)
|
.with_style(settings.theme.selector.input_editor.container)
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -218,7 +218,8 @@ impl ThemeSelector {
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
|
|
||||||
self.selected_index = self.selected_index
|
self.selected_index = self
|
||||||
|
.selected_index
|
||||||
.min(self.matches.len().saturating_sub(1));
|
.min(self.matches.len().saturating_sub(1));
|
||||||
|
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
@ -341,7 +342,8 @@ impl View for ThemeSelector {
|
||||||
Container::new(
|
Container::new(
|
||||||
Flex::new(Axis::Vertical)
|
Flex::new(Axis::Vertical)
|
||||||
.with_child(
|
.with_child(
|
||||||
ChildView::new(&self.query_editor).contained()
|
ChildView::new(&self.query_editor)
|
||||||
|
.contained()
|
||||||
.with_style(settings.theme.selector.input_editor.container)
|
.with_style(settings.theme.selector.input_editor.container)
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -755,7 +755,11 @@ impl Workspace {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the model that was toggled closed if it was open
|
// Returns the model that was toggled closed if it was open
|
||||||
pub fn toggle_modal<V, F>(&mut self, cx: &mut ViewContext<Self>, add_view: F) -> Option<ViewHandle<V>>
|
pub fn toggle_modal<V, F>(
|
||||||
|
&mut self,
|
||||||
|
cx: &mut ViewContext<Self>,
|
||||||
|
add_view: F,
|
||||||
|
) -> Option<ViewHandle<V>>
|
||||||
where
|
where
|
||||||
V: 'static + View,
|
V: 'static + View,
|
||||||
F: FnOnce(&mut ViewContext<Self>, &mut Self) -> ViewHandle<V>,
|
F: FnOnce(&mut ViewContext<Self>, &mut Self) -> ViewHandle<V>,
|
||||||
|
@ -763,8 +767,7 @@ impl Workspace {
|
||||||
cx.notify();
|
cx.notify();
|
||||||
// Whatever modal was visible is getting clobbered. If its the same type as V, then return
|
// Whatever modal was visible is getting clobbered. If its the same type as V, then return
|
||||||
// it. Otherwise, create a new modal and set it as active.
|
// it. Otherwise, create a new modal and set it as active.
|
||||||
let already_open_modal = self.modal.take()
|
let already_open_modal = self.modal.take().and_then(|modal| modal.downcast::<V>());
|
||||||
.and_then(|modal| modal.downcast::<V>());
|
|
||||||
if let Some(already_open_modal) = already_open_modal {
|
if let Some(already_open_modal) = already_open_modal {
|
||||||
cx.focus_self();
|
cx.focus_self();
|
||||||
Some(already_open_modal)
|
Some(already_open_modal)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue