Don't rely on action propagation for zooming in and out
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
parent
adf361b374
commit
f87ae6032e
6 changed files with 94 additions and 64 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue