Don't rely on action propagation for zooming in and out

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
Antonio Scandurra
2023-05-16 10:34:50 -06:00
committed by Nathan Sobo
co-authored by Antonio Scandurra
parent adf361b374
commit f87ae6032e
6 changed files with 94 additions and 64 deletions
+4 -2
View File
@@ -135,6 +135,7 @@ pub enum Event {
ChangeItemTitle,
Focus,
ZoomIn,
ZoomOut,
}
pub struct Pane {
@@ -661,8 +662,9 @@ impl Pane {
}
pub fn toggle_zoom(&mut self, _: &ToggleZoom, cx: &mut ViewContext<Self>) {
cx.propagate_action();
if !self.zoomed {
if self.zoomed {
cx.emit(Event::ZoomOut);
} else {
cx.emit(Event::ZoomIn);
}
}