Always focus a panel when zooming it
This allows us to zoom a panel when clicking a button, even if the panel isn't currently focused.
This commit is contained in:
parent
a49189a704
commit
1707652643
2 changed files with 5 additions and 10 deletions
|
@ -384,13 +384,7 @@ impl AssistantPanel {
|
|||
})
|
||||
.with_cursor_style(CursorStyle::PointingHand)
|
||||
.on_click(MouseButton::Left, |_, this, cx| {
|
||||
if this.zoomed {
|
||||
cx.emit(AssistantPanelEvent::ZoomOut)
|
||||
} else {
|
||||
this.has_focus = true; // Hack: Because focus_in is processed last, we need to set this here.
|
||||
cx.focus_self();
|
||||
cx.emit(AssistantPanelEvent::ZoomIn);
|
||||
}
|
||||
this.toggle_zoom(&ToggleZoom, cx);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue