Add double click to zoom the window
Co-Authored-By: Antonio <me@as-cii.com>
This commit is contained in:
parent
bd54bfa4e1
commit
803d2b6710
3 changed files with 31 additions and 13 deletions
|
@ -678,10 +678,15 @@ impl MacWindow {
|
|||
|
||||
impl Drop for MacWindow {
|
||||
fn drop(&mut self) {
|
||||
let native_window = self.0.lock().native_window;
|
||||
unsafe {
|
||||
native_window.close();
|
||||
}
|
||||
let this = self.0.lock();
|
||||
let window = this.native_window;
|
||||
this.executor
|
||||
.spawn(async move {
|
||||
unsafe {
|
||||
window.close();
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -868,17 +873,25 @@ impl PlatformWindow for MacWindow {
|
|||
fn zoom(&self) {
|
||||
let this = self.0.lock();
|
||||
let window = this.native_window;
|
||||
unsafe {
|
||||
window.zoom_(nil);
|
||||
}
|
||||
this.executor
|
||||
.spawn(async move {
|
||||
unsafe {
|
||||
window.zoom_(nil);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
||||
fn toggle_full_screen(&self) {
|
||||
let this = self.0.lock();
|
||||
let window = this.native_window;
|
||||
unsafe {
|
||||
window.toggleFullScreen_(nil);
|
||||
}
|
||||
this.executor
|
||||
.spawn(async move {
|
||||
unsafe {
|
||||
window.toggleFullScreen_(nil);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
||||
fn on_input(&self, callback: Box<dyn FnMut(InputEvent) -> bool>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue