Monster commit: native version
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use ratatui::layout::{Constraint, Layout, Rect};
|
||||
use ratatui::style::{Color, Modifier, Style};
|
||||
use ratatui::style::{Modifier, Style};
|
||||
use ratatui::text::{Line, Span};
|
||||
use ratatui::widgets::{Block, Paragraph};
|
||||
use ratatui::Frame;
|
||||
@@ -8,6 +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};
|
||||
|
||||
const MIN_ROW_HEIGHT: u16 = 1;
|
||||
|
||||
@@ -31,11 +32,7 @@ fn render_banks(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area
|
||||
let [title_area, inner] =
|
||||
Layout::vertical([Constraint::Length(1), Constraint::Fill(1)]).areas(area);
|
||||
|
||||
let title_color = if is_focused {
|
||||
Color::Rgb(100, 160, 180)
|
||||
} else {
|
||||
Color::Rgb(70, 75, 85)
|
||||
};
|
||||
let title_color = if is_focused { ui::HEADER } else { ui::UNFOCUSED };
|
||||
let title = Paragraph::new("Banks")
|
||||
.style(Style::new().fg(title_color))
|
||||
.alignment(ratatui::layout::Alignment::Center);
|
||||
@@ -94,12 +91,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, _, _) => (Color::Cyan, Color::Black, ""),
|
||||
(false, true, _) => (Color::Rgb(45, 80, 45), Color::Green, "> "),
|
||||
(false, false, true) => (Color::Rgb(80, 60, 100), Color::Magenta, "+ "),
|
||||
(false, false, false) if is_selected => (Color::Rgb(60, 65, 75), Color::White, ""),
|
||||
(false, false, false) if is_edit => (Color::Rgb(45, 106, 95), Color::White, ""),
|
||||
(false, false, false) => (Color::Reset, Color::Rgb(120, 125, 135), ""),
|
||||
(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, ""),
|
||||
};
|
||||
|
||||
let name = app.project_state.project.banks[idx]
|
||||
@@ -139,7 +136,7 @@ fn render_banks(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area
|
||||
}
|
||||
|
||||
// Scroll indicators
|
||||
let indicator_style = Style::new().fg(Color::Rgb(120, 125, 135));
|
||||
let indicator_style = Style::new().fg(ui::TEXT_MUTED);
|
||||
if scroll_offset > 0 {
|
||||
let indicator = Paragraph::new("▲")
|
||||
.style(indicator_style)
|
||||
@@ -163,11 +160,7 @@ fn render_patterns(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, a
|
||||
let [title_area, inner] =
|
||||
Layout::vertical([Constraint::Length(1), Constraint::Fill(1)]).areas(area);
|
||||
|
||||
let title_color = if is_focused {
|
||||
Color::Rgb(100, 160, 180)
|
||||
} else {
|
||||
Color::Rgb(70, 75, 85)
|
||||
};
|
||||
let title_color = if is_focused { ui::HEADER } else { ui::UNFOCUSED };
|
||||
|
||||
let bank = app.patterns_nav.bank_cursor;
|
||||
let bank_name = app.project_state.project.banks[bank].name.as_deref();
|
||||
@@ -256,13 +249,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, _, _, _) => (Color::Cyan, Color::Black, ""),
|
||||
(false, true, _, true) => (Color::Rgb(120, 60, 80), Color::Magenta, "- "),
|
||||
(false, true, _, false) => (Color::Rgb(45, 80, 45), Color::Green, "> "),
|
||||
(false, false, true, _) => (Color::Rgb(80, 60, 100), Color::Magenta, "+ "),
|
||||
(false, false, false, _) if is_selected => (Color::Rgb(60, 65, 75), Color::White, ""),
|
||||
(false, false, false, _) if is_edit => (Color::Rgb(45, 106, 95), Color::White, ""),
|
||||
(false, false, false, _) => (Color::Reset, Color::Rgb(120, 125, 135), ""),
|
||||
(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, ""),
|
||||
};
|
||||
|
||||
let pattern = &app.project_state.project.banks[bank].patterns[idx];
|
||||
@@ -321,7 +314,7 @@ fn render_patterns(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, a
|
||||
}
|
||||
|
||||
// Scroll indicators
|
||||
let indicator_style = Style::new().fg(Color::Rgb(120, 125, 135));
|
||||
let indicator_style = Style::new().fg(ui::TEXT_MUTED);
|
||||
if scroll_offset > 0 {
|
||||
let indicator = Paragraph::new("▲")
|
||||
.style(indicator_style)
|
||||
|
||||
Reference in New Issue
Block a user