Monster commit: native version
This commit is contained in:
@@ -5,6 +5,7 @@ use ratatui::Frame;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::engine::SequencerSnapshot;
|
||||
use crate::theme::{meter, selection, tile, ui};
|
||||
use crate::widgets::{Orientation, Scope, Spectrum, VuMeter};
|
||||
|
||||
pub fn render(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area: Rect) {
|
||||
@@ -67,7 +68,7 @@ fn render_sequencer(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot,
|
||||
if area.width < 50 {
|
||||
let msg = Paragraph::new("Terminal too narrow")
|
||||
.alignment(Alignment::Center)
|
||||
.style(Style::new().fg(Color::Rgb(120, 125, 135)));
|
||||
.style(Style::new().fg(ui::TEXT_MUTED));
|
||||
frame.render_widget(msg, area);
|
||||
return;
|
||||
}
|
||||
@@ -147,41 +148,27 @@ fn render_tile(
|
||||
};
|
||||
|
||||
let link_color = step.and_then(|s| s.source).map(|src| {
|
||||
const BRIGHT: [(u8, u8, u8); 5] = [
|
||||
(180, 140, 220),
|
||||
(220, 140, 170),
|
||||
(220, 180, 130),
|
||||
(130, 180, 220),
|
||||
(170, 220, 140),
|
||||
];
|
||||
const DIM: [(u8, u8, u8); 5] = [
|
||||
(90, 70, 120),
|
||||
(120, 70, 85),
|
||||
(120, 90, 65),
|
||||
(65, 90, 120),
|
||||
(85, 120, 70),
|
||||
];
|
||||
let i = src % 5;
|
||||
(BRIGHT[i], DIM[i])
|
||||
(tile::LINK_BRIGHT[i], tile::LINK_DIM[i])
|
||||
});
|
||||
|
||||
let (bg, fg) = match (is_playing, is_active, is_selected, is_linked, in_selection) {
|
||||
(true, true, _, _, _) => (Color::Rgb(195, 85, 65), Color::White),
|
||||
(true, false, _, _, _) => (Color::Rgb(180, 120, 45), Color::Black),
|
||||
(true, true, _, _, _) => (tile::PLAYING_ACTIVE_BG, tile::PLAYING_ACTIVE_FG),
|
||||
(true, false, _, _, _) => (tile::PLAYING_INACTIVE_BG, tile::PLAYING_INACTIVE_FG),
|
||||
(false, true, true, true, _) => {
|
||||
let (r, g, b) = link_color.unwrap().0;
|
||||
(Color::Rgb(r, g, b), Color::Black)
|
||||
(Color::Rgb(r, g, b), selection::CURSOR_FG)
|
||||
}
|
||||
(false, true, true, false, _) => (Color::Rgb(0, 220, 180), Color::Black),
|
||||
(false, true, _, _, true) => (Color::Rgb(0, 170, 140), Color::Black),
|
||||
(false, true, true, false, _) => (tile::ACTIVE_SELECTED_BG, selection::CURSOR_FG),
|
||||
(false, true, _, _, true) => (tile::ACTIVE_IN_RANGE_BG, selection::CURSOR_FG),
|
||||
(false, true, false, true, _) => {
|
||||
let (r, g, b) = link_color.unwrap().1;
|
||||
(Color::Rgb(r, g, b), Color::White)
|
||||
(Color::Rgb(r, g, b), tile::ACTIVE_FG)
|
||||
}
|
||||
(false, true, false, false, _) => (Color::Rgb(45, 106, 95), Color::White),
|
||||
(false, false, true, _, _) => (Color::Rgb(80, 180, 255), Color::Black),
|
||||
(false, false, _, _, true) => (Color::Rgb(60, 140, 200), Color::Black),
|
||||
(false, false, false, _, _) => (Color::Rgb(45, 48, 55), Color::Rgb(120, 125, 135)),
|
||||
(false, true, false, false, _) => (tile::ACTIVE_BG, tile::ACTIVE_FG),
|
||||
(false, false, true, _, _) => (selection::SELECTED, selection::CURSOR_FG),
|
||||
(false, false, _, _, true) => (selection::IN_RANGE, selection::CURSOR_FG),
|
||||
(false, false, false, _, _) => (tile::INACTIVE_BG, tile::INACTIVE_FG),
|
||||
};
|
||||
|
||||
let source_idx = step.and_then(|s| s.source);
|
||||
@@ -246,7 +233,7 @@ fn render_tile(
|
||||
fn render_scope(frame: &mut Frame, app: &App, area: Rect) {
|
||||
let scope = Scope::new(&app.metrics.scope)
|
||||
.orientation(Orientation::Horizontal)
|
||||
.color(Color::Green);
|
||||
.color(meter::LOW);
|
||||
frame.render_widget(scope, area);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user