Feat: early mouse support

This commit is contained in:
2026-02-14 16:26:29 +01:00
parent 5e7fd8b79c
commit cfaadd9d33
23 changed files with 1256 additions and 285 deletions

View File

@@ -12,13 +12,17 @@ use crate::widgets::{
render_scroll_indicators, render_section_header, IndicatorAlign, Orientation, Scope, Spectrum,
};
pub fn render(frame: &mut Frame, app: &App, area: Rect) {
let [left_col, _, right_col] = Layout::horizontal([
pub fn layout(area: Rect) -> [Rect; 3] {
Layout::horizontal([
Constraint::Percentage(55),
Constraint::Length(2),
Constraint::Percentage(45),
])
.areas(area);
.areas(area)
}
pub fn render(frame: &mut Frame, app: &App, area: Rect) {
let [left_col, _, right_col] = layout(area);
render_settings_section(frame, app, left_col);
render_visualizers(frame, app, right_col);
@@ -185,7 +189,7 @@ fn truncate_name(name: &str, max_len: usize) -> String {
}
}
fn list_height(item_count: usize) -> u16 {
pub fn list_height(item_count: usize) -> u16 {
let visible = item_count.min(5) as u16;
if item_count > 5 {
visible + 1
@@ -194,7 +198,7 @@ fn list_height(item_count: usize) -> u16 {
}
}
fn devices_section_height(app: &App) -> u16 {
pub fn devices_section_height(app: &App) -> u16 {
let output_h = list_height(app.audio.output_devices.len());
let input_h = list_height(app.audio.input_devices.len());
3 + output_h.max(input_h)