diff options
Diffstat (limited to 'default-plugins/status-bar/src/tip/data/use_mouse.rs')
-rw-r--r-- | default-plugins/status-bar/src/tip/data/use_mouse.rs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/default-plugins/status-bar/src/tip/data/use_mouse.rs b/default-plugins/status-bar/src/tip/data/use_mouse.rs new file mode 100644 index 000000000..b9c8de580 --- /dev/null +++ b/default-plugins/status-bar/src/tip/data/use_mouse.rs @@ -0,0 +1,56 @@ +use ansi_term::{ + unstyled_len, ANSIString, ANSIStrings, + Color::{Fixed, RGB}, + Style, +}; + +use crate::LinePart; +use zellij_tile::prelude::*; +use zellij_tile_utils::palette_match; + +macro_rules! strings { + ($ANSIStrings:expr) => {{ + let strings: &[ANSIString<'static>] = $ANSIStrings; + + let ansi_strings = ANSIStrings(strings); + + LinePart { + part: format!("{}", ansi_strings), + len: unstyled_len(&ansi_strings), + } + }}; +} + +pub fn use_mouse_full(palette: Palette) -> LinePart { + // Tip: Use the mouse to switch pane focus, scroll through the pane + // scrollbuffer, switch or scroll through tabs + let green_color = palette_match!(palette.green); + + strings!(&[ + Style::new().paint(" Tip: "), + Style::new().fg(green_color).bold().paint("Use the mouse"), + Style::new().paint(" to switch pane focus, scroll through the pane scrollbuffer, switch or scroll through the tabs."), + ]) +} + +pub fn use_mouse_medium(palette: Palette) -> LinePart { + // Tip: Use the mouse to switch panes/tabs or scroll through the pane + // scrollbuffer + let green_color = palette_match!(palette.green); + + strings!(&[ + Style::new().paint(" Tip: "), + Style::new().fg(green_color).bold().paint("Use the mouse"), + Style::new().paint(" to switch pane/tabs or scroll through the pane scrollbuffer."), + ]) +} + +pub fn use_mouse_short(palette: Palette) -> LinePart { + // Tip: Use the mouse to switch panes/tabs or scroll + let green_color = palette_match!(palette.green); + + strings!(&[ + Style::new().fg(green_color).bold().paint(" Use the mouse"), + Style::new().paint(" to switch pane/tabs or scroll."), + ]) +} |