Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Experimented with selection colors.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed Aug 27, 2023
1 parent 43df454 commit b2825d1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ui/terminal_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,15 @@ impl MainWindow {
}

fn show_terminal_area(&mut self, ui: &mut egui::Ui) {
let mut settings = self.get_options().monitor_settings.clone();

settings.selection_fg = self.screen_mode.get_selection_fg();
settings.selection_bg = self.screen_mode.get_selection_bg();

let opt = icy_engine_egui::TerminalOptions {
focus_lock: matches!(self.get_mode(), MainWindowMode::ShowTerminal),
filter: self.get_options().scaling.get_filter(),
settings: self.get_options().monitor_settings.clone(),
settings,
stick_to_bottom: true,
font_extension: self.screen_mode.get_font_extension(),
use_terminal_height: true,
Expand Down
20 changes: 20 additions & 0 deletions src/ui/util/screen_modes.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::fmt::Display;

use egui::Color32;
use icy_engine::{
BitFont, Palette, Size, ATARI_DEFAULT_PALETTE, C64_DEFAULT_PALETTE, VIEWDATA_PALETTE,
};
Expand Down Expand Up @@ -127,4 +128,23 @@ impl ScreenMode {
}
buf.clear();
}

pub(crate) fn get_selection_fg(&self) -> egui::Color32 {
match self {
ScreenMode::Default |
ScreenMode::Vga(_, _) => Color32::from_rgb(0xAA, 0x00, 0xAA),
ScreenMode::Vic => Color32::from_rgb(0x37, 0x39, 0xC4),
ScreenMode::Antic => Color32::from_rgb(0x09, 0x51, 0x83),
ScreenMode::Videotex => Color32::from_rgb(0, 0, 0),
}
}
pub(crate) fn get_selection_bg(&self) -> egui::Color32 {
match self {
ScreenMode::Default |
ScreenMode::Vga(_, _) => Color32::from_rgb(0xAA, 0xAA, 0xAA),
ScreenMode::Vic => Color32::from_rgb(0xB0, 0x3F, 0xB6),
ScreenMode::Antic => Color32::from_rgb(0xFF, 0xFF, 0xFF),
ScreenMode::Videotex => Color32::from_rgb(0xFF, 0xFF, 0xFF),
}
}
}

0 comments on commit b2825d1

Please sign in to comment.