File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ pub enum WindowCommand {
82
82
SetCursorPosition {
83
83
position : Vec2 ,
84
84
} ,
85
+ SetMaximized {
86
+ maximized : bool ,
87
+ } ,
85
88
}
86
89
87
90
/// Defines the way a window is displayed
@@ -140,6 +143,12 @@ impl Window {
140
143
self . height
141
144
}
142
145
146
+ #[ inline]
147
+ pub fn set_maximized ( & mut self , maximized : bool ) {
148
+ self . command_queue
149
+ . push ( WindowCommand :: SetMaximized { maximized } ) ;
150
+ }
151
+
143
152
pub fn set_resolution ( & mut self , width : u32 , height : u32 ) {
144
153
self . width = width;
145
154
self . height = height;
Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ fn change_window(_: &mut World, resources: &mut Resources) {
104
104
) )
105
105
. unwrap_or_else ( |e| error ! ( "Unable to set cursor position: {}" , e) ) ;
106
106
}
107
+ bevy_window:: WindowCommand :: SetMaximized { maximized } => {
108
+ let window = winit_windows. get_window ( id) . unwrap ( ) ;
109
+ window. set_maximized ( maximized)
110
+ }
107
111
}
108
112
}
109
113
}
You can’t perform that action at this time.
0 commit comments