Fixing color schemes

This commit is contained in:
2026-01-30 20:15:43 +01:00
parent 44d1e9af24
commit eb3969b952
22 changed files with 2888 additions and 482 deletions

View File

@@ -8,7 +8,7 @@ use crate::app::App;
use crate::engine::SequencerSnapshot;
use crate::model::{MAX_BANKS, MAX_PATTERNS};
use crate::state::PatternsColumn;
use crate::theme::{list, selection, ui};
use crate::theme;
const MIN_ROW_HEIGHT: u16 = 1;
@@ -27,12 +27,13 @@ pub fn render(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area:
}
fn render_banks(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area: Rect) {
let theme = theme::get();
let is_focused = matches!(app.patterns_nav.column, PatternsColumn::Banks);
let [title_area, inner] =
Layout::vertical([Constraint::Length(1), Constraint::Fill(1)]).areas(area);
let title_color = if is_focused { ui::HEADER } else { ui::UNFOCUSED };
let title_color = if is_focused { theme.ui.header } else { theme.ui.unfocused };
let title = Paragraph::new("Banks")
.style(Style::new().fg(title_color))
.alignment(ratatui::layout::Alignment::Center);
@@ -91,12 +92,12 @@ fn render_banks(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area
let is_staged = banks_with_staged.contains(&idx);
let (bg, fg, prefix) = match (is_cursor, is_playing, is_staged) {
(true, _, _) => (selection::CURSOR, selection::CURSOR_FG, ""),
(false, true, _) => (list::PLAYING_BG, list::PLAYING_FG, "> "),
(false, false, true) => (list::STAGED_PLAY_BG, list::STAGED_PLAY_FG, "+ "),
(false, false, false) if is_selected => (list::HOVER_BG, list::HOVER_FG, ""),
(false, false, false) if is_edit => (list::EDIT_BG, list::EDIT_FG, ""),
(false, false, false) => (ui::BG, ui::TEXT_MUTED, ""),
(true, _, _) => (theme.selection.cursor, theme.selection.cursor_fg, ""),
(false, true, _) => (theme.list.playing_bg, theme.list.playing_fg, "> "),
(false, false, true) => (theme.list.staged_play_bg, theme.list.staged_play_fg, "+ "),
(false, false, false) if is_selected => (theme.list.hover_bg, theme.list.hover_fg, ""),
(false, false, false) if is_edit => (theme.list.edit_bg, theme.list.edit_fg, ""),
(false, false, false) => (theme.ui.bg, theme.ui.text_muted, ""),
};
let name = app.project_state.project.banks[idx]
@@ -136,7 +137,7 @@ fn render_banks(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area
}
// Scroll indicators
let indicator_style = Style::new().fg(ui::TEXT_MUTED);
let indicator_style = Style::new().fg(theme.ui.text_muted);
if scroll_offset > 0 {
let indicator = Paragraph::new("")
.style(indicator_style)
@@ -155,12 +156,13 @@ fn render_banks(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area
fn render_patterns(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area: Rect) {
use crate::model::PatternSpeed;
let theme = theme::get();
let is_focused = matches!(app.patterns_nav.column, PatternsColumn::Patterns);
let [title_area, inner] =
Layout::vertical([Constraint::Length(1), Constraint::Fill(1)]).areas(area);
let title_color = if is_focused { ui::HEADER } else { ui::UNFOCUSED };
let title_color = if is_focused { theme.ui.header } else { theme.ui.unfocused };
let bank = app.patterns_nav.bank_cursor;
let bank_name = app.project_state.project.banks[bank].name.as_deref();
@@ -249,13 +251,13 @@ fn render_patterns(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, a
let is_staged_stop = staged_to_stop.contains(&idx);
let (bg, fg, prefix) = match (is_cursor, is_playing, is_staged_play, is_staged_stop) {
(true, _, _, _) => (selection::CURSOR, selection::CURSOR_FG, ""),
(false, true, _, true) => (list::STAGED_STOP_BG, list::STAGED_STOP_FG, "- "),
(false, true, _, false) => (list::PLAYING_BG, list::PLAYING_FG, "> "),
(false, false, true, _) => (list::STAGED_PLAY_BG, list::STAGED_PLAY_FG, "+ "),
(false, false, false, _) if is_selected => (list::HOVER_BG, list::HOVER_FG, ""),
(false, false, false, _) if is_edit => (list::EDIT_BG, list::EDIT_FG, ""),
(false, false, false, _) => (ui::BG, ui::TEXT_MUTED, ""),
(true, _, _, _) => (theme.selection.cursor, theme.selection.cursor_fg, ""),
(false, true, _, true) => (theme.list.staged_stop_bg, theme.list.staged_stop_fg, "- "),
(false, true, _, false) => (theme.list.playing_bg, theme.list.playing_fg, "> "),
(false, false, true, _) => (theme.list.staged_play_bg, theme.list.staged_play_fg, "+ "),
(false, false, false, _) if is_selected => (theme.list.hover_bg, theme.list.hover_fg, ""),
(false, false, false, _) if is_edit => (theme.list.edit_bg, theme.list.edit_fg, ""),
(false, false, false, _) => (theme.ui.bg, theme.ui.text_muted, ""),
};
let pattern = &app.project_state.project.banks[bank].patterns[idx];
@@ -314,7 +316,7 @@ fn render_patterns(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, a
}
// Scroll indicators
let indicator_style = Style::new().fg(ui::TEXT_MUTED);
let indicator_style = Style::new().fg(theme.ui.text_muted);
if scroll_offset > 0 {
let indicator = Paragraph::new("")
.style(indicator_style)