@@ -114,16 +114,14 @@ impl page::Page<crate::pages::Message> for Page {
114114 match & self . context {
115115 Some ( Context :: AddApplication ( directory_type) ) => {
116116 let search = widget:: search_input ( fl ! ( "type-to-search" ) , & self . application_search )
117- . on_input ( Message :: ApplicationSearch )
118- . on_clear ( Message :: ApplicationSearch ( String :: new ( ) ) )
119- . apply ( Element :: from)
120- . map ( crate :: pages:: Message :: from) ;
117+ . on_input ( |i| Message :: ApplicationSearch ( i) . into ( ) )
118+ . on_clear ( Message :: ApplicationSearch ( String :: new ( ) ) . into ( ) )
119+ . apply ( Element :: from) ;
121120
122121 Some (
123122 cosmic:: app:: context_drawer (
124- self . add_application_context_view ( directory_type. clone ( ) )
125- . map ( crate :: pages:: Message :: from) ,
126- crate :: pages:: Message :: CloseContextDrawer ,
123+ self . add_application_context_view ( directory_type. clone ( ) ) ,
124+ crate :: pages:: Message :: CloseContextDrawer . into ( ) ,
127125 )
128126 . title ( fl ! ( "startup-apps" , "search-for-application" ) )
129127 . header ( search) ,
@@ -158,7 +156,7 @@ impl page::Page<crate::pages::Message> for Page {
158156 task
159157 }
160158
161- fn dialog ( & self ) -> Option < Element < ' _ , crate :: pages:: Message > > {
159+ fn dialog ( & self ) -> Option < crate :: pages:: Element < ' _ > > {
162160 if let Some ( app_to_remove) = & self . app_to_remove {
163161 if let Some ( cached_startup_apps) = & self . cached_startup_apps {
164162 if let Some ( target_directory_type) = & self . target_directory_type {
@@ -171,19 +169,21 @@ impl page::Page<crate::pages::Message> for Page {
171169 ) )
172170 . icon ( icon:: from_name ( "dialog-warning" ) . size ( 64 ) )
173171 . body ( fl ! ( "startup-apps" , "remove-dialog-description" ) )
174- . primary_action ( button:: suggested ( fl ! ( "remove" ) ) . on_press (
175- Message :: RemoveStartupApplication (
176- target_directory_type. clone ( ) ,
177- app_to_remove. clone ( ) ,
178- true ,
172+ . primary_action (
173+ button:: suggested ( fl ! ( "remove" ) ) . on_press (
174+ Message :: RemoveStartupApplication (
175+ target_directory_type. clone ( ) ,
176+ app_to_remove. clone ( ) ,
177+ true ,
178+ )
179+ . into ( ) ,
179180 ) ,
180- ) )
181+ )
181182 . secondary_action (
182183 button:: standard ( fl ! ( "cancel" ) )
183- . on_press ( Message :: CancelRemoveStartupApplication ) ,
184+ . on_press ( Message :: CancelRemoveStartupApplication . into ( ) ) ,
184185 )
185- . apply ( Element :: from)
186- . map ( crate :: pages:: Message :: StartupApps ) ,
186+ . apply ( Element :: from) ,
187187 ) ;
188188 }
189189 }
@@ -322,7 +322,7 @@ impl Page {
322322 pub fn add_application_context_view (
323323 & self ,
324324 directory_type : DirectoryType ,
325- ) -> Element < ' _ , crate :: pages:: Message > {
325+ ) -> crate :: pages:: Element < ' _ > {
326326 let cosmic:: cosmic_theme:: Spacing { space_xs, .. } = cosmic:: theme:: spacing ( ) ;
327327
328328 let mut list = widget:: list_column ( ) ;
@@ -350,9 +350,15 @@ impl Page {
350350 } else {
351351 row = row. push ( text ( & app. appid ) . width ( Length :: Fill ) ) ;
352352 }
353- row = row. push ( widget:: button:: text ( fl ! ( "add" ) ) . on_press (
354- Message :: AddStartupApplication ( directory_type. clone ( ) , app. clone ( ) ) ,
355- ) ) ;
353+ row = row. push (
354+ widget:: button:: text ( fl ! ( "add" ) ) . on_press (
355+ Message :: AddStartupApplication (
356+ directory_type. clone ( ) ,
357+ app. clone ( ) ,
358+ )
359+ . into ( ) ,
360+ ) ,
361+ ) ;
356362
357363 list = list. add ( row)
358364 }
@@ -361,8 +367,7 @@ impl Page {
361367 }
362368 }
363369
364- list. apply ( Element :: from)
365- . map ( crate :: pages:: Message :: StartupApps )
370+ list. into ( )
366371 }
367372}
368373
@@ -409,19 +414,22 @@ fn apps() -> Section<crate::pages::Message> {
409414 row = row. push (
410415 button:: icon ( icon:: from_name ( "edit-delete-symbolic" ) )
411416 . extra_small ( )
412- . on_press ( Message :: RemoveStartupApplication (
413- directory_type. clone ( ) ,
414- app. clone ( ) ,
415- false ,
416- ) ) ,
417+ . on_press (
418+ Message :: RemoveStartupApplication (
419+ directory_type. clone ( ) ,
420+ app. clone ( ) ,
421+ false ,
422+ )
423+ . into ( ) ,
424+ ) ,
417425 ) ;
418426
419427 section = section. add ( row)
420428 }
421429 }
422430
423431 let add_startup_app = widget:: button:: standard ( fl ! ( "startup-apps" , "add" ) )
424- . on_press ( Message :: ShowApplicationSidebar ( directory_type. clone ( ) ) ) ;
432+ . on_press ( Message :: ShowApplicationSidebar ( directory_type. clone ( ) ) . into ( ) ) ;
425433
426434 view = view. push ( section) . push ( widget:: container (
427435 widget:: container ( add_startup_app)
@@ -431,8 +439,7 @@ fn apps() -> Section<crate::pages::Message> {
431439 }
432440 }
433441
434- view. apply ( Element :: from)
435- . map ( crate :: pages:: Message :: StartupApps )
442+ view. into ( )
436443 } )
437444}
438445
0 commit comments