@@ -38,12 +38,6 @@ pub enum FocusedBlock {
3838 SetDeviceAliasBox ,
3939}
4040
41- #[ derive( Debug , Clone , Copy , PartialEq ) ]
42- pub enum ColorMode {
43- Dark ,
44- Light ,
45- }
46-
4741#[ derive( Debug ) ]
4842pub struct App {
4943 pub running : bool ,
@@ -57,19 +51,12 @@ pub struct App {
5751 pub new_devices_state : TableState ,
5852 pub focused_block : FocusedBlock ,
5953 pub pairing_confirmation : PairingConfirmation ,
60- pub color_mode : ColorMode ,
6154 pub new_alias : Input ,
6255 pub config : Arc < Config > ,
6356}
6457
6558impl App {
6659 pub async fn new ( config : Arc < Config > ) -> AppResult < Self > {
67- let color_mode = match terminal_light:: luma ( ) {
68- Ok ( luma) if luma > 0.6 => ColorMode :: Light ,
69- Ok ( _) => ColorMode :: Dark ,
70- Err ( _) => ColorMode :: Dark ,
71- } ;
72-
7360 let session = Arc :: new ( bluer:: Session :: new ( ) . await ?) ;
7461
7562 let pairing_confirmation = PairingConfirmation :: new ( ) ;
@@ -116,7 +103,6 @@ impl App {
116103 new_devices_state : TableState :: default ( ) ,
117104 focused_block : FocusedBlock :: PairedDevices ,
118105 pairing_confirmation,
119- color_mode,
120106 new_alias : Input :: default ( ) ,
121107 config,
122108 } )
@@ -520,18 +506,9 @@ impl App {
520506 . bottom_margin ( 1 )
521507 } else {
522508 Row :: new ( vec ! [
523- Cell :: from( "Name" ) . style( match self . color_mode {
524- ColorMode :: Dark => Style :: default ( ) . fg( Color :: White ) ,
525- ColorMode :: Light => Style :: default ( ) . fg( Color :: Black ) ,
526- } ) ,
527- Cell :: from( "Trusted" ) . style( match self . color_mode {
528- ColorMode :: Dark => Style :: default ( ) . fg( Color :: White ) ,
529- ColorMode :: Light => Style :: default ( ) . fg( Color :: Black ) ,
530- } ) ,
531- Cell :: from( "Connected" ) . style( match self . color_mode {
532- ColorMode :: Dark => Style :: default ( ) . fg( Color :: White ) ,
533- ColorMode :: Light => Style :: default ( ) . fg( Color :: Black ) ,
534- } ) ,
509+ Cell :: from( "Name" ) ,
510+ Cell :: from( "Trusted" ) ,
511+ Cell :: from( "Connected" ) ,
535512 ] )
536513 . style ( Style :: new ( ) . bold ( ) )
537514 . bottom_margin ( 1 )
0 commit comments