* Expose set_minimized. Implement for macOS (#985) * Implement set_minimized for Wayland (#985) Co-Authored-By: Victor Berger <vberger@users.noreply.github.com> * Implement set_minimized for Windows (#985) * Remove debug logs (#985) * Implement Window::set_minimized for X11 * Remove extra param from set_window_flags call * Cargo fmt * Add example of usage * Update changelog * Update feature matrix * Cargo fmt * Update example to remove unnecessary event var * Stop setting window styles when minimizing (#985) * Add stub for WASM (#985) Co-authored-by: Victor Berger <vberger@users.noreply.github.com> Co-authored-by: Murarth <murarth@gmail.com> Co-authored-by: Freya Gentz <zegentzy@protonmail.com> Co-authored-by: Osspial <osspial@gmail.com>
This commit is contained in:
parent
92741aa4ec
commit
82889e2367
14 changed files with 172 additions and 2 deletions
|
|
@ -617,6 +617,25 @@ impl UnownedWindow {
|
|||
self.set_maximized(maximized);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_minimized(&self, minimized: bool) {
|
||||
let is_minimized: BOOL = unsafe { msg_send![*self.ns_window, isMiniaturized] };
|
||||
let is_minimized: bool = is_minimized == YES;
|
||||
if is_minimized == minimized {
|
||||
return;
|
||||
}
|
||||
|
||||
if minimized {
|
||||
unsafe {
|
||||
NSWindow::miniaturize_(*self.ns_window, *self.ns_window);
|
||||
}
|
||||
} else {
|
||||
unsafe {
|
||||
NSWindow::deminiaturize_(*self.ns_window, *self.ns_window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_maximized(&self, maximized: bool) {
|
||||
let is_zoomed = self.is_zoomed();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue