Implement default macOS menu items
- `Zed -> Hide`, bound to `cmd-h` - `Zed -> Hide Others`, bound to `alt-cmd-h` - `Zed -> Show All` - `Window -> Minimize`, bound to `cmd-m` - `Window -> Zoom`
This commit is contained in:
parent
dc9df64078
commit
7cbf76ce80
8 changed files with 124 additions and 1 deletions
|
@ -568,6 +568,25 @@ impl platform::Window for Window {
|
|||
let _: () = msg_send![app, orderFrontCharacterPalette: window];
|
||||
}
|
||||
}
|
||||
|
||||
fn minimize(&self) {
|
||||
let window = self.0.borrow().native_window;
|
||||
unsafe {
|
||||
window.miniaturize_(nil);
|
||||
}
|
||||
}
|
||||
|
||||
fn zoom(&self) {
|
||||
let this = self.0.borrow();
|
||||
let window = this.native_window;
|
||||
this.executor
|
||||
.spawn(async move {
|
||||
unsafe {
|
||||
window.zoom_(nil);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
}
|
||||
|
||||
impl platform::WindowContext for Window {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue