diff options
| author | Denis Maximov <denismaximov98@gmail.com> | 2021-05-02 13:53:36 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-02 13:53:36 +0300 |
| commit | 98d9eacd2221162c60f71b73ea7f40ff7256e225 (patch) | |
| tree | bad162ac3c59a16723f75fcd32d6d0cc724be09e /src/tests | |
| parent | docs(changelog): Improved Config Loading #423 (diff) | |
| parent | chore: remove unused dependency from zellij-tile (diff) | |
| download | sl0ppij-98d9eacd2221162c60f71b73ea7f40ff7256e225.tar.gz sl0ppij-98d9eacd2221162c60f71b73ea7f40ff7256e225.tar.xz sl0ppij-98d9eacd2221162c60f71b73ea7f40ff7256e225.zip | |
Merge pull request #239 from zellij-org/x-colors
X colors
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/fakes.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/fakes.rs b/src/tests/fakes.rs index c9504a98..e00de017 100644 --- a/src/tests/fakes.rs +++ b/src/tests/fakes.rs @@ -8,6 +8,8 @@ use std::time::{Duration, Instant}; use crate::os_input_output::OsApi; use crate::tests::possible_tty_inputs::{get_possible_tty_inputs, Bytes}; +use crate::utils::shared::colors; +use zellij_tile::data::{Palette, PaletteSource, Theme}; use crate::tests::utils::commands::{QUIT, SLEEP}; @@ -73,6 +75,7 @@ pub struct FakeInputOutput { last_snapshot_time: Arc<Mutex<Instant>>, should_trigger_sigwinch: Arc<(Mutex<bool>, Condvar)>, sigwinch_event: Option<PositionAndSize>, + palette: Arc<Mutex<Palette>>, } impl FakeInputOutput { @@ -81,6 +84,21 @@ impl FakeInputOutput { let last_snapshot_time = Arc::new(Mutex::new(Instant::now())); let stdout_writer = FakeStdoutWriter::new(last_snapshot_time.clone()); win_sizes.insert(0, winsize); // 0 is the current terminal + let palette: Palette = Palette { + source: PaletteSource::Default, + theme: Theme::Dark, + fg: colors::BRIGHT_GRAY, + bg: colors::GRAY, + black: colors::BLACK, + red: colors::RED, + green: colors::GREEN, + yellow: colors::GRAY, + blue: colors::GRAY, + magenta: colors::GRAY, + cyan: colors::GRAY, + white: colors::WHITE, + orange: colors::ORANGE, + }; FakeInputOutput { read_buffers: Arc::new(Mutex::new(HashMap::new())), stdin_writes: Arc::new(Mutex::new(HashMap::new())), @@ -93,6 +111,7 @@ impl FakeInputOutput { possible_tty_inputs: get_possible_tty_inputs(), should_trigger_sigwinch: Arc::new((Mutex::new(false), Condvar::new())), sigwinch_event: None, + palette: Arc::new(Mutex::new(palette)), } } pub fn with_tty_inputs(mut self, tty_inputs: HashMap<u16, Bytes>) -> Self { @@ -235,4 +254,22 @@ impl OsApi for FakeInputOutput { cb(); } } + fn load_palette(&self) -> Palette { + let palette: Palette = Palette { + source: PaletteSource::Default, + theme: Theme::Dark, + fg: colors::BRIGHT_GRAY, + bg: colors::GRAY, + black: colors::BLACK, + red: colors::RED, + green: colors::GREEN, + yellow: colors::GRAY, + blue: colors::GRAY, + magenta: colors::GRAY, + cyan: colors::GRAY, + white: colors::WHITE, + orange: colors::ORANGE, + }; + palette + } } |
