Feat: early mouse support
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user