Node.js: Add fullscreen setter for Window

Amends 779aff0b39
This commit is contained in:
Simon Hausmann 2024-01-09 15:59:40 +01:00 committed by Simon Hausmann
parent 438b9afeaa
commit 29621043f7
2 changed files with 9 additions and 0 deletions

View file

@ -78,6 +78,9 @@ export interface Window {
/** Issues a request to the windowing system to re-render the contents of the window. */
requestRedraw(): void;
/** Set or unset the window to display fullscreen. */
set fullscreen(enable: boolean);
}
/**

View file

@ -123,4 +123,10 @@ impl JsWindow {
pub fn request_redraw(&self) {
self.inner.request_redraw();
}
/// Set or unset the window to display fullscreen.
#[napi(setter)]
pub fn set_fullscreen(&self, enable: bool) {
self.inner.window().set_fullscreen(enable)
}
}