vastly improved selection system
This commit is contained in:
@@ -119,6 +119,9 @@ fn render_tile(
|
||||
let is_active = step.map(|s| s.active).unwrap_or(false);
|
||||
let is_linked = step.map(|s| s.source.is_some()).unwrap_or(false);
|
||||
let is_selected = step_idx == app.editor_ctx.step;
|
||||
let in_selection = app.editor_ctx.selection_range()
|
||||
.map(|r| r.contains(&step_idx))
|
||||
.unwrap_or(false);
|
||||
|
||||
let is_playing = if app.playback.playing {
|
||||
snapshot.get_step(app.editor_ctx.bank, app.editor_ctx.pattern) == Some(step_idx)
|
||||
@@ -145,21 +148,23 @@ fn render_tile(
|
||||
(BRIGHT[i], DIM[i])
|
||||
});
|
||||
|
||||
let (bg, fg) = match (is_playing, is_active, is_selected, is_linked) {
|
||||
(true, true, _, _) => (Color::Rgb(195, 85, 65), Color::White),
|
||||
(true, false, _, _) => (Color::Rgb(180, 120, 45), Color::Black),
|
||||
(false, true, true, true) => {
|
||||
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),
|
||||
(false, true, true, true, _) => {
|
||||
let (r, g, b) = link_color.unwrap().0;
|
||||
(Color::Rgb(r, g, b), Color::Black)
|
||||
}
|
||||
(false, true, true, false) => (Color::Rgb(0, 220, 180), Color::Black),
|
||||
(false, true, false, true) => {
|
||||
(false, true, true, false, _) => (Color::Rgb(0, 220, 180), Color::Black),
|
||||
(false, true, _, _, true) => (Color::Rgb(0, 170, 140), Color::Black),
|
||||
(false, true, false, true, _) => {
|
||||
let (r, g, b) = link_color.unwrap().1;
|
||||
(Color::Rgb(r, g, b), Color::White)
|
||||
}
|
||||
(false, true, false, false) => (Color::Rgb(45, 106, 95), Color::White),
|
||||
(false, false, true, _) => (Color::Rgb(80, 180, 255), Color::Black),
|
||||
(false, false, false, _) => (Color::Rgb(45, 48, 55), Color::Rgb(120, 125, 135)),
|
||||
(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)),
|
||||
};
|
||||
|
||||
let symbol = if is_playing {
|
||||
|
||||
Reference in New Issue
Block a user