@@ -367,56 +367,60 @@ impl Application for TweakTool {
367
367
368
368
fn footer ( & self ) -> Option < Element < Self :: Message > > {
369
369
let spacing = cosmic:: theme:: active ( ) . cosmic ( ) . spacing ;
370
- match self . color_schemes . model . active_data :: < Tab > ( ) {
371
- Some ( Tab :: Installed ) => Some (
372
- widget:: row ( )
373
- . push ( widget:: horizontal_space ( ) )
374
- . push (
375
- widget:: button:: standard ( fl ! ( "save-current-color-scheme" ) )
376
- . trailing_icon ( icons:: get_handle ( "arrow-into-box-symbolic" , 16 ) )
377
- . on_press ( Message :: ColorSchemes ( Box :: new (
378
- color_schemes:: Message :: SaveCurrentColorScheme ( None ) ,
379
- ) ) ) ,
380
- )
381
- . push (
382
- widget:: button:: standard ( fl ! ( "import-color-scheme" ) )
383
- . trailing_icon ( icons:: get_handle ( "document-save-symbolic" , 16 ) )
384
- . on_press ( Message :: ColorSchemes ( Box :: new (
385
- color_schemes:: Message :: StartImport ,
386
- ) ) ) ,
387
- )
388
- . spacing ( spacing. space_xxs )
389
- . apply ( widget:: container)
390
- . class ( cosmic:: style:: Container :: Card )
391
- . padding ( spacing. space_xxs )
392
- . into ( ) ,
393
- ) ,
394
- Some ( Tab :: Available ) => Some (
395
- widget:: row ( )
396
- . push ( widget:: horizontal_space ( ) )
397
- . push ( match self . color_schemes . status {
398
- Status :: Idle => widget:: button:: standard ( fl ! ( "show-more" ) )
399
- . leading_icon ( crate :: core:: icons:: get_handle (
400
- "content-loading-symbolic" ,
401
- 16 ,
402
- ) )
403
- . on_press ( Message :: ColorSchemes ( Box :: new (
404
- color_schemes:: Message :: FetchAvailableColorSchemes (
405
- color_schemes:: ColorSchemeProvider :: CosmicThemes ,
406
- self . color_schemes . limit ,
407
- ) ,
408
- ) ) ) ,
409
- Status :: LoadingMore | Status :: Loading => {
410
- widget:: button:: standard ( fl ! ( "loading" ) )
411
- }
412
- } )
413
- . spacing ( spacing. space_xxs )
414
- . apply ( widget:: container)
415
- . class ( cosmic:: style:: Container :: Card )
416
- . padding ( spacing. space_xxs )
417
- . into ( ) ,
418
- ) ,
419
- None => None ,
370
+
371
+ match self . nav_model . active_data :: < Page > ( ) {
372
+ Some ( Page :: ColorSchemes ) => match self . color_schemes . model . active_data :: < Tab > ( ) {
373
+ Some ( Tab :: Installed ) => Some (
374
+ widget:: row ( )
375
+ . push ( widget:: horizontal_space ( ) )
376
+ . push (
377
+ widget:: button:: standard ( fl ! ( "save-current-color-scheme" ) )
378
+ . trailing_icon ( icons:: get_handle ( "arrow-into-box-symbolic" , 16 ) )
379
+ . on_press ( Message :: ColorSchemes ( Box :: new (
380
+ color_schemes:: Message :: SaveCurrentColorScheme ( None ) ,
381
+ ) ) ) ,
382
+ )
383
+ . push (
384
+ widget:: button:: standard ( fl ! ( "import-color-scheme" ) )
385
+ . trailing_icon ( icons:: get_handle ( "document-save-symbolic" , 16 ) )
386
+ . on_press ( Message :: ColorSchemes ( Box :: new (
387
+ color_schemes:: Message :: StartImport ,
388
+ ) ) ) ,
389
+ )
390
+ . spacing ( spacing. space_xxs )
391
+ . apply ( widget:: container)
392
+ . class ( cosmic:: style:: Container :: Card )
393
+ . padding ( spacing. space_xxs )
394
+ . into ( ) ,
395
+ ) ,
396
+ Some ( Tab :: Available ) => Some (
397
+ widget:: row ( )
398
+ . push ( widget:: horizontal_space ( ) )
399
+ . push ( match self . color_schemes . status {
400
+ Status :: Idle => widget:: button:: standard ( fl ! ( "show-more" ) )
401
+ . leading_icon ( crate :: core:: icons:: get_handle (
402
+ "content-loading-symbolic" ,
403
+ 16 ,
404
+ ) )
405
+ . on_press ( Message :: ColorSchemes ( Box :: new (
406
+ color_schemes:: Message :: FetchAvailableColorSchemes (
407
+ color_schemes:: ColorSchemeProvider :: CosmicThemes ,
408
+ self . color_schemes . limit ,
409
+ ) ,
410
+ ) ) ) ,
411
+ Status :: LoadingMore | Status :: Loading => {
412
+ widget:: button:: standard ( fl ! ( "loading" ) )
413
+ }
414
+ } )
415
+ . spacing ( spacing. space_xxs )
416
+ . apply ( widget:: container)
417
+ . class ( cosmic:: style:: Container :: Card )
418
+ . padding ( spacing. space_xxs )
419
+ . into ( ) ,
420
+ ) ,
421
+ None => None ,
422
+ } ,
423
+ _ => None ,
420
424
}
421
425
}
422
426
0 commit comments