Skip to content

Commit f25e2ef

Browse files
committed
remove terminal light dep
1 parent 85ca8f6 commit f25e2ef

File tree

3 files changed

+3
-56
lines changed

3 files changed

+3
-56
lines changed

Cargo.lock

Lines changed: 0 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ dirs = "6"
2222
toml = "0.9"
2323
serde = { version = "1", features = ["derive"] }
2424
clap = { version = "4", features = ["derive", "cargo"] }
25-
terminal-light = "1"
2625
tui-input = "0.12"
2726

2827
[profile.release]

src/app.rs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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)]
4842
pub 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

6558
impl 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

Comments
 (0)