Feat: entretien de la codebase
This commit is contained in:
@@ -9,6 +9,7 @@ use crate::engine::SequencerSnapshot;
|
||||
use crate::model::{MAX_BANKS, MAX_PATTERNS};
|
||||
use crate::state::PatternsColumn;
|
||||
use crate::theme;
|
||||
use crate::widgets::{render_scroll_indicators, IndicatorAlign};
|
||||
|
||||
const MIN_ROW_HEIGHT: u16 = 1;
|
||||
|
||||
@@ -171,21 +172,15 @@ fn render_banks(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area
|
||||
frame.render_widget(para, text_area);
|
||||
}
|
||||
|
||||
// Scroll indicators
|
||||
let indicator_style = Style::new().fg(theme.ui.text_muted);
|
||||
if scroll_offset > 0 {
|
||||
let indicator = Paragraph::new("▲")
|
||||
.style(indicator_style)
|
||||
.alignment(ratatui::layout::Alignment::Center);
|
||||
frame.render_widget(indicator, Rect { height: 1, ..inner });
|
||||
}
|
||||
if scroll_offset + visible_count < MAX_BANKS {
|
||||
let y = inner.y + inner.height.saturating_sub(1);
|
||||
let indicator = Paragraph::new("▼")
|
||||
.style(indicator_style)
|
||||
.alignment(ratatui::layout::Alignment::Center);
|
||||
frame.render_widget(indicator, Rect { y, height: 1, ..inner });
|
||||
}
|
||||
render_scroll_indicators(
|
||||
frame,
|
||||
inner,
|
||||
scroll_offset,
|
||||
visible_count,
|
||||
MAX_BANKS,
|
||||
theme.ui.text_muted,
|
||||
IndicatorAlign::Center,
|
||||
);
|
||||
}
|
||||
|
||||
fn render_patterns(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, area: Rect) {
|
||||
@@ -419,19 +414,13 @@ fn render_patterns(frame: &mut Frame, app: &App, snapshot: &SequencerSnapshot, a
|
||||
frame.render_widget(Paragraph::new(Line::from(spans)), text_area);
|
||||
}
|
||||
|
||||
// Scroll indicators
|
||||
let indicator_style = Style::new().fg(theme.ui.text_muted);
|
||||
if scroll_offset > 0 {
|
||||
let indicator = Paragraph::new("▲")
|
||||
.style(indicator_style)
|
||||
.alignment(ratatui::layout::Alignment::Center);
|
||||
frame.render_widget(indicator, Rect { height: 1, ..inner });
|
||||
}
|
||||
if scroll_offset + visible_count < MAX_PATTERNS {
|
||||
let y = inner.y + inner.height.saturating_sub(1);
|
||||
let indicator = Paragraph::new("▼")
|
||||
.style(indicator_style)
|
||||
.alignment(ratatui::layout::Alignment::Center);
|
||||
frame.render_widget(indicator, Rect { y, height: 1, ..inner });
|
||||
}
|
||||
render_scroll_indicators(
|
||||
frame,
|
||||
inner,
|
||||
scroll_offset,
|
||||
visible_count,
|
||||
MAX_PATTERNS,
|
||||
theme.ui.text_muted,
|
||||
IndicatorAlign::Center,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user