File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ pub enum WindowCommand {
8282 SetCursorPosition {
8383 position : Vec2 ,
8484 } ,
85+ SetMaximized {
86+ maximized : bool ,
87+ } ,
8588}
8689
8790/// Defines the way a window is displayed
@@ -140,6 +143,12 @@ impl Window {
140143 self . height
141144 }
142145
146+ #[ inline]
147+ pub fn set_maximized ( & mut self , maximized : bool ) {
148+ self . command_queue
149+ . push ( WindowCommand :: SetMaximized { maximized } ) ;
150+ }
151+
143152 pub fn set_resolution ( & mut self , width : u32 , height : u32 ) {
144153 self . width = width;
145154 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) {
104104 ) )
105105 . unwrap_or_else ( |e| error ! ( "Unable to set cursor position: {}" , e) ) ;
106106 }
107+ bevy_window:: WindowCommand :: SetMaximized { maximized } => {
108+ let window = winit_windows. get_window ( id) . unwrap ( ) ;
109+ window. set_maximized ( maximized)
110+ }
107111 }
108112 }
109113 }
You can’t perform that action at this time.
0 commit comments