@@ -13,7 +13,10 @@ use std::{
13
13
} ;
14
14
15
15
use eframe:: {
16
- egui:: { Button , CentralPanel , ComboBox , Context , Frame , Grid , Layout , ProgressBar , Window } ,
16
+ egui:: {
17
+ Button , CentralPanel , ComboBox , Context , Frame , Grid , Layout , ProgressBar , ViewportCommand ,
18
+ Window ,
19
+ } ,
17
20
emath:: { Align , Align2 } ,
18
21
epaint:: Color32 ,
19
22
} ;
@@ -423,7 +426,7 @@ impl Launcher {
423
426
}
424
427
425
428
impl eframe:: App for Launcher {
426
- fn update ( & mut self , ctx : & Context , frame : & mut eframe:: Frame ) {
429
+ fn update ( & mut self , ctx : & Context , _ : & mut eframe:: Frame ) {
427
430
while let Ok ( msg) = self . rx . try_recv ( ) {
428
431
match msg {
429
432
WorkerMsg :: VersionData ( data) => self . version_data = Some ( data) ,
@@ -470,7 +473,7 @@ impl eframe::App for Launcher {
470
473
}
471
474
}
472
475
self . tx . send ( GuiMsg :: Quit ) . unwrap ( ) ;
473
- frame . close ( ) ;
476
+ ctx . send_viewport_cmd ( ViewportCommand :: Close ) ;
474
477
}
475
478
if ui
476
479
. add_enabled (
@@ -548,11 +551,10 @@ impl eframe::App for Launcher {
548
551
} ) ;
549
552
}
550
553
} ) ;
551
- }
552
554
553
- fn on_close_event ( & mut self ) -> bool {
554
- self . tx . send ( GuiMsg :: Quit ) . unwrap ( ) ;
555
- true
555
+ if ctx . input ( |i| i . viewport ( ) . close_requested ( ) ) {
556
+ self . tx . send ( GuiMsg :: Quit ) . unwrap ( ) ;
557
+ }
556
558
}
557
559
}
558
560
@@ -756,7 +758,7 @@ async fn install(
756
758
757
759
let buffer = download ( tx, "Downloading Streamer" , & url, client) . await ?;
758
760
759
- let mut installation_dir = data_dir ( ) . extended ( VERSIONS_SUBDIR ) . extended ( & release. tag ) ;
761
+ let installation_dir = data_dir ( ) . extended ( VERSIONS_SUBDIR ) . extended ( & release. tag ) ;
760
762
761
763
fs:: create_dir_all ( & installation_dir) ?;
762
764
0 commit comments