@@ -13,7 +13,10 @@ use std::{
1313} ;
1414
1515use 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+ } ,
1720 emath:: { Align , Align2 } ,
1821 epaint:: Color32 ,
1922} ;
@@ -423,7 +426,7 @@ impl Launcher {
423426}
424427
425428impl 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 ) {
427430 while let Ok ( msg) = self . rx . try_recv ( ) {
428431 match msg {
429432 WorkerMsg :: VersionData ( data) => self . version_data = Some ( data) ,
@@ -470,7 +473,7 @@ impl eframe::App for Launcher {
470473 }
471474 }
472475 self . tx . send ( GuiMsg :: Quit ) . unwrap ( ) ;
473- frame . close ( ) ;
476+ ctx . send_viewport_cmd ( ViewportCommand :: Close ) ;
474477 }
475478 if ui
476479 . add_enabled (
@@ -548,11 +551,10 @@ impl eframe::App for Launcher {
548551 } ) ;
549552 }
550553 } ) ;
551- }
552554
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+ }
556558 }
557559}
558560
@@ -756,7 +758,7 @@ async fn install(
756758
757759 let buffer = download ( tx, "Downloading Streamer" , & url, client) . await ?;
758760
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 ) ;
760762
761763 fs:: create_dir_all ( & installation_dir) ?;
762764
0 commit comments