Feat: mixed bag
This commit is contained in:
@@ -496,13 +496,22 @@ fn render_patterns(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, a
|
||||
height: 1,
|
||||
};
|
||||
|
||||
let label = format!(
|
||||
let right_label = format!(
|
||||
"{} · {}",
|
||||
pattern.quantization.label(),
|
||||
pattern.sync_mode.label()
|
||||
);
|
||||
let w = detail_area.width as usize;
|
||||
let padded_label = format!("{label:>w$}");
|
||||
let label = if let Some(desc) = &pattern.description {
|
||||
let right_len = right_label.chars().count();
|
||||
let max_desc = w.saturating_sub(right_len + 1);
|
||||
let truncated: String = desc.chars().take(max_desc).collect();
|
||||
let pad = w.saturating_sub(truncated.chars().count() + right_len);
|
||||
format!("{truncated}{}{right_label}", " ".repeat(pad))
|
||||
} else {
|
||||
format!("{right_label:>w$}")
|
||||
};
|
||||
let padded_label = label;
|
||||
|
||||
let filled_width = if is_playing {
|
||||
let ratio = snapshot.get_smooth_progress(bank, idx, length, speed.multiplier()).unwrap_or(0.0);
|
||||
@@ -725,6 +734,7 @@ fn render_properties(
|
||||
let pattern = &app.project_state.project.banks[bank].patterns[pattern_idx];
|
||||
|
||||
let name = pattern.name.as_deref().unwrap_or("-");
|
||||
let desc = pattern.description.as_deref().unwrap_or("-");
|
||||
let content_count = pattern.content_step_count();
|
||||
let steps_label = format!("{}/{}", content_count, pattern.length);
|
||||
let speed_label = pattern.speed.label();
|
||||
@@ -739,6 +749,10 @@ fn render_properties(
|
||||
Span::styled(" Name ", label_style),
|
||||
Span::styled(name, value_style),
|
||||
]),
|
||||
Line::from(vec![
|
||||
Span::styled(" Desc ", label_style),
|
||||
Span::styled(desc, value_style),
|
||||
]),
|
||||
Line::from(vec![
|
||||
Span::styled(" Steps ", label_style),
|
||||
Span::styled(steps_label, value_style),
|
||||
|
||||
Reference in New Issue
Block a user