diff --git a/television/config/themes.rs b/television/config/themes.rs index 8f64558..db8f47d 100644 --- a/television/config/themes.rs +++ b/television/config/themes.rs @@ -110,6 +110,7 @@ pub struct Theme { pub channel_mode_fg: Color, pub remote_control_mode_fg: Color, pub send_to_channel_mode_fg: Color, + pub action_mode_fg: Color, } impl Theme { @@ -181,6 +182,7 @@ struct Inner { channel_mode_fg: String, remote_control_mode_fg: String, send_to_channel_mode_fg: String, + action_mode_fg: String, } impl<'de> Deserialize<'de> for Theme { @@ -317,6 +319,13 @@ impl<'de> Deserialize<'de> for Theme { &inner.send_to_channel_mode_fg )) })?, + action_mode_fg: Color::from_str(&inner.action_mode_fg) + .ok_or_else(|| { + serde::de::Error::custom(format!( + "invalid color {}", + &inner.action_mode_fg + )) + })?, }) } } @@ -440,6 +449,7 @@ impl Into for &Theme { channel: (&self.channel_mode_fg).into(), remote_control: (&self.remote_control_mode_fg).into(), send_to_channel: (&self.send_to_channel_mode_fg).into(), + action: (&self.action_mode_fg).into(), } } } @@ -467,6 +477,7 @@ mod tests { channel_mode_fg = "bright-white" remote_control_mode_fg = "bright-white" send_to_channel_mode_fg = "bright-white" + action_mode_fg = "bright-white" "##; let theme: Theme = toml::from_str(theme_content).unwrap(); assert_eq!( @@ -520,6 +531,7 @@ mod tests { channel_mode_fg = "bright-white" remote_control_mode_fg = "bright-white" send_to_channel_mode_fg = "bright-white" + action_mode_fg = "bright-white" "##; let theme: Theme = toml::from_str(theme_content).unwrap(); assert_eq!(theme.background, None); @@ -553,5 +565,6 @@ mod tests { theme.send_to_channel_mode_fg, Color::Ansi(ANSIColor::BrightWhite) ); + assert_eq!(theme.action_mode_fg, Color::Ansi(ANSIColor::BrightWhite)); } } diff --git a/television/screen/colors.rs b/television/screen/colors.rs index 4f9f3f1..636cf09 100644 --- a/television/screen/colors.rs +++ b/television/screen/colors.rs @@ -52,4 +52,5 @@ pub struct ModeColorscheme { pub channel: Color, pub remote_control: Color, pub send_to_channel: Color, + pub action: Color, } diff --git a/television/screen/keybindings.rs b/television/screen/keybindings.rs index 0b362a4..09b5807 100644 --- a/television/screen/keybindings.rs +++ b/television/screen/keybindings.rs @@ -213,6 +213,9 @@ pub fn build_keybindings_table<'a>( colorscheme, ) } + Mode::Action => { + todo!("Implement keybindings table for action mode"); + } } } diff --git a/television/screen/metadata.rs b/television/screen/metadata.rs index 2ca1beb..8a30a4f 100644 --- a/television/screen/metadata.rs +++ b/television/screen/metadata.rs @@ -16,6 +16,7 @@ impl Display for Mode { Mode::Channel => write!(f, "Channel"), Mode::RemoteControl => write!(f, "Remote Control"), Mode::SendToChannel => write!(f, "Send to Channel"), + Mode::Action => write!(f, "Action"), } } } diff --git a/television/screen/mode.rs b/television/screen/mode.rs index 439b287..4a2aa20 100644 --- a/television/screen/mode.rs +++ b/television/screen/mode.rs @@ -7,5 +7,6 @@ pub fn mode_color(mode: Mode, colorscheme: &ModeColorscheme) -> Color { Mode::Channel => colorscheme.channel, Mode::RemoteControl => colorscheme.remote_control, Mode::SendToChannel => colorscheme.send_to_channel, + Mode::Action => colorscheme.action, } } diff --git a/television/television.rs b/television/television.rs index d140ca8..1497c46 100644 --- a/television/television.rs +++ b/television/television.rs @@ -29,6 +29,7 @@ pub enum Mode { Channel, RemoteControl, SendToChannel, + Action, } pub struct Television { @@ -187,6 +188,9 @@ impl Television { Mode::RemoteControl | Mode::SendToChannel => { self.remote_control.as_mut().unwrap().find(pattern); } + Mode::Action => { + todo!("Action mode not implemented yet"); + } } } @@ -209,6 +213,9 @@ impl Television { } None } + Mode::Action => { + todo!("Action mode not implemented yet"); + } } } @@ -238,6 +245,9 @@ impl Television { self.remote_control.as_ref().unwrap().total_count(), &mut self.rc_picker, ), + Mode::Action => { + todo!("Action mode not implemented yet"); + } }; if result_count == 0 { return; @@ -258,6 +268,9 @@ impl Television { self.remote_control.as_ref().unwrap().total_count(), &mut self.rc_picker, ), + Mode::Action => { + todo!("Action mode not implemented yet"); + } }; if result_count == 0 { return; @@ -275,6 +288,9 @@ impl Television { Mode::RemoteControl | Mode::SendToChannel => { self.rc_picker.reset_selection(); } + Mode::Action => { + todo!("Action mode not implemented yet"); + } } } @@ -284,6 +300,9 @@ impl Television { Mode::RemoteControl | Mode::SendToChannel => { self.rc_picker.reset_input(); } + Mode::Action => { + todo!("Action mode not implemented yet"); + } } } } @@ -422,6 +441,9 @@ impl Television { Mode::RemoteControl | Mode::SendToChannel => { &mut self.rc_picker.input } + Mode::Action => { + todo!("Action mode not implemented yet"); + } }; input.handle(convert_action_to_input_request(action).unwrap()); match action { @@ -459,7 +481,7 @@ impl Television { self.reset_picker_selection(); self.mode = Mode::Channel; } - Mode::SendToChannel => {} + _ => {} } } @@ -480,6 +502,7 @@ impl Television { self.reset_picker_selection(); self.mode = Mode::Channel; } + Mode::Action => {} } } @@ -528,6 +551,9 @@ impl Television { self.change_channel(new_channel); } } + Mode::Action => { + todo!("Action mode not implemented yet"); + } } Ok(()) } diff --git a/themes/catppuccin.toml b/themes/catppuccin.toml index 6172ccd..4cc29f2 100644 --- a/themes/catppuccin.toml +++ b/themes/catppuccin.toml @@ -19,3 +19,4 @@ preview_title_fg = '#fab387' channel_mode_fg = '#f5c2e7' remote_control_mode_fg = '#a6e3a1' send_to_channel_mode_fg = '#89dceb' +action_mode_fg = '#f38ba8' diff --git a/themes/default.toml b/themes/default.toml index 5bfbdd2..f90e372 100644 --- a/themes/default.toml +++ b/themes/default.toml @@ -19,3 +19,4 @@ preview_title_fg = 'bright-magenta' channel_mode_fg = 'green' remote_control_mode_fg = 'yellow' send_to_channel_mode_fg = 'cyan' +action_mode_fg = 'red' diff --git a/themes/dracula.toml b/themes/dracula.toml index 76ea1a2..8645fa6 100644 --- a/themes/dracula.toml +++ b/themes/dracula.toml @@ -19,3 +19,4 @@ preview_title_fg = '#50FA7B' channel_mode_fg = '#8BE9FD' remote_control_mode_fg = '#FFB86C' send_to_channel_mode_fg = '#FF79C6' +action_mode_fg = '#FF5555' diff --git a/themes/gruvbox-dark.toml b/themes/gruvbox-dark.toml index 961d78a..d4a5ec6 100644 --- a/themes/gruvbox-dark.toml +++ b/themes/gruvbox-dark.toml @@ -19,3 +19,4 @@ preview_title_fg = '#b8bb26' channel_mode_fg = '#b16286' remote_control_mode_fg = '#8ec07c' send_to_channel_mode_fg = '#458588' +action_mode_fg = '#fb4934' diff --git a/themes/gruvbox-light.toml b/themes/gruvbox-light.toml index 1e4872c..aeceb1e 100644 --- a/themes/gruvbox-light.toml +++ b/themes/gruvbox-light.toml @@ -19,4 +19,4 @@ preview_title_fg = '#98971a' channel_mode_fg = '#d65d0e' remote_control_mode_fg = '#689d6a' send_to_channel_mode_fg = '#458588' - +action_mode_fg = '#af3a03' diff --git a/themes/monokai.toml b/themes/monokai.toml index 780d0ef..d557ce6 100644 --- a/themes/monokai.toml +++ b/themes/monokai.toml @@ -19,3 +19,4 @@ preview_title_fg = '#fd971f' channel_mode_fg = '#fd971f' remote_control_mode_fg = '#a6e22e' send_to_channel_mode_fg = '#66d9ef' +action_mode_fg = '#f92672' diff --git a/themes/nord-dark.toml b/themes/nord-dark.toml index 87ca0d2..1989570 100644 --- a/themes/nord-dark.toml +++ b/themes/nord-dark.toml @@ -19,3 +19,4 @@ preview_title_fg = '#8fbcbb' channel_mode_fg = '#b48ead' remote_control_mode_fg = '#a3be8c' send_to_channel_mode_fg = '#d08770' +action_mode_fg = '#bf616a' diff --git a/themes/onedark.toml b/themes/onedark.toml index d24198e..e64dee9 100644 --- a/themes/onedark.toml +++ b/themes/onedark.toml @@ -19,3 +19,4 @@ preview_title_fg = '#61afef' channel_mode_fg = '#61afef' remote_control_mode_fg = '#98c379' send_to_channel_mode_fg = '#c678dd' +action_mode_fg = '#e06c75' diff --git a/themes/solarized-dark.toml b/themes/solarized-dark.toml index 619b8e0..61da80c 100644 --- a/themes/solarized-dark.toml +++ b/themes/solarized-dark.toml @@ -19,3 +19,4 @@ preview_title_fg = '#859900' channel_mode_fg = '#2aa198' remote_control_mode_fg = '#859900' send_to_channel_mode_fg = '#dc322f' +action_mode_fg = '#cb4b16' diff --git a/themes/solarized-light.toml b/themes/solarized-light.toml index ce50b52..e0a5558 100644 --- a/themes/solarized-light.toml +++ b/themes/solarized-light.toml @@ -19,3 +19,4 @@ preview_title_fg = '#859900' channel_mode_fg = '#2aa198' remote_control_mode_fg = '#859900' send_to_channel_mode_fg = '#dc322f' +action_mode_fg = '#cb4b16' diff --git a/themes/television.toml b/themes/television.toml index e522371..6d40843 100644 --- a/themes/television.toml +++ b/themes/television.toml @@ -20,3 +20,4 @@ preview_title_fg = '#d2a374' channel_mode_fg = '#8faf77' remote_control_mode_fg = '#d2a374' send_to_channel_mode_fg = '#d2788c' +action_mode_fg = '#d2788c' diff --git a/themes/tokyonight.toml b/themes/tokyonight.toml index 5e35251..e015ad9 100644 --- a/themes/tokyonight.toml +++ b/themes/tokyonight.toml @@ -19,4 +19,4 @@ preview_title_fg = '#bb9af7' channel_mode_fg = '#faba4a' remote_control_mode_fg = '#9ece6a' send_to_channel_mode_fg = '#a4daff' - +action_mode_fg = '#f7768e'