Add window maximization API
Implement a simple API to set a window to maximized. Implement it only for the X11 backend.
This commit is contained in:
parent
17de3f1d15
commit
a4052b8693
4 changed files with 90 additions and 42 deletions
|
|
@ -66,6 +66,13 @@ impl WindowBuilder {
|
|||
self
|
||||
}
|
||||
|
||||
/// Requests maximized mode.
|
||||
#[inline]
|
||||
pub fn with_maximized(mut self, maximized: bool) -> WindowBuilder {
|
||||
self.window.maximized = maximized;
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets whether the window will be initially hidden or visible.
|
||||
#[inline]
|
||||
pub fn with_visibility(mut self, visible: bool) -> WindowBuilder {
|
||||
|
|
@ -292,6 +299,12 @@ impl Window {
|
|||
self.window.set_cursor_state(state)
|
||||
}
|
||||
|
||||
/// Sets the window to maximized or back
|
||||
#[inline]
|
||||
pub fn set_maximized(&self, maximized: bool) {
|
||||
self.window.set_maximized(maximized)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn id(&self) -> WindowId {
|
||||
WindowId(self.window.id())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue