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 18:01:18 +02:00 committed by Nathan Sobo
parent adf361b374
commit f87ae6032e
6 changed files with 94 additions and 64 deletions

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);
}
}