termusiclib/config/tui_overlay.rs
1/// The TUI Settings to use, with possible overwrite (like from CLI)
2#[derive(Debug, Clone, PartialEq, Default)]
3#[allow(clippy::module_name_repetitions)]
4pub struct TuiOverlay {
5 /// The saved TUI-Settings
6 pub settings: super::v2::tui::TuiSettings,
7
8 /// Disable TUI images (like cover-art) from being displayed in the terminal
9 ///
10 /// This option will not be saved to the config and prevent saving to the config value
11 ///
12 /// (disables ueberzug, sixel, iterm, kitty image displaying)
13 pub coverart_hidden_overwrite: Option<bool>,
14}
15
16impl TuiOverlay {
17 /// Get whether the coverart should be hidden or not, either the overwrite if present, otherwise the config itself
18 ///
19 /// true => hidden
20 #[must_use]
21 pub fn get_coverart_hidden(&self) -> bool {
22 if let Some(overwrite) = self.coverart_hidden_overwrite {
23 overwrite
24 } else {
25 self.settings.coverart.hidden
26 }
27 }
28}