From 798498b45b09e1d9615553646c99aa78d38674a6 Mon Sep 17 00:00:00 2001 From: Debarka Kundu Date: Thu, 7 May 2026 13:36:58 +0530 Subject: [PATCH 1/2] refactor: wrap device views in scrollable containers and update height constraints to shrink --- linux-rust/src/ui/airpods.rs | 2 +- linux-rust/src/ui/nothing.rs | 2 +- linux-rust/src/ui/window.rs | 20 +++++++++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/linux-rust/src/ui/airpods.rs b/linux-rust/src/ui/airpods.rs index 9335b5e05..c1a757392 100644 --- a/linux-rust/src/ui/airpods.rs +++ b/linux-rust/src/ui/airpods.rs @@ -520,7 +520,7 @@ pub fn airpods_view<'a>( ]) .padding(20) .center_x(Length::Fill) - .height(Length::Fill) + .height(Length::Shrink) } fn run_async_in_thread(fut: F) diff --git a/linux-rust/src/ui/nothing.rs b/linux-rust/src/ui/nothing.rs index d683f0b16..19295ba9e 100644 --- a/linux-rust/src/ui/nothing.rs +++ b/linux-rust/src/ui/nothing.rs @@ -175,7 +175,7 @@ pub fn nothing_view<'a>( ]) .padding(20) .center_x(Length::Fill) - .height(Length::Fill) + .height(Length::Shrink) } fn run_async_in_thread(fut: F) diff --git a/linux-rust/src/ui/window.rs b/linux-rust/src/ui/window.rs index 4574b97ce..47a2d39a0 100644 --- a/linux-rust/src/ui/window.rs +++ b/linux-rust/src/ui/window.rs @@ -871,12 +871,16 @@ impl App { match state { DeviceState::AirPods(state) => { device_managers.get(id).and_then(|managers| { - managers.get_aacp().map(|aacp_manager| airpods_view( - id, - &devices_list, - state, - aacp_manager.clone() - )) + managers.get_aacp().map(|aacp_manager| { + let view = airpods_view( + id, + &devices_list, + state, + aacp_manager.clone(), + ); + container(scrollable(view).height(Length::Fill)) + .height(Length::Fill) + }) }) } _ => None, @@ -893,7 +897,9 @@ impl App { if let Some(DeviceState::Nothing(state)) = device_state { if let Some(device_managers) = device_managers.get(id) { if let Some(att_manager) = device_managers.get_att() { - nothing_view(id, &devices_list, state, att_manager.clone()) + let view = nothing_view(id, &devices_list, state, att_manager.clone()); + container(scrollable(view).height(Length::Fill)) + .height(Length::Fill) } else { error!("No ATT manager found for Nothing device {}", id); container( From 0838408074044636e3fe13ac1e65411c69f8551c Mon Sep 17 00:00:00 2001 From: Debarka Kundu Date: Tue, 12 May 2026 13:09:41 +0530 Subject: [PATCH 2/2] refactor: move scrollable wrapping into view functions Addresses maintainer feedback from PR #586 review: - Move scrollable() into airpods_view() and nothing_view() so each view owns its own scroll behavior - Revert window.rs to call views directly without external wrapping - Fix indentation in the Nothing branch of window.rs - Views now fill available space with height(Length::Fill) and scroll internally when content exceeds viewport --- linux-rust/src/ui/airpods.rs | 10 ++++++---- linux-rust/src/ui/nothing.rs | 10 ++++++---- linux-rust/src/ui/window.rs | 20 +++++++------------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/linux-rust/src/ui/airpods.rs b/linux-rust/src/ui/airpods.rs index c1a757392..e1e0444c0 100644 --- a/linux-rust/src/ui/airpods.rs +++ b/linux-rust/src/ui/airpods.rs @@ -5,7 +5,7 @@ use iced::overlay::menu; use iced::widget::button::Style; use iced::widget::rule::FillMode; use iced::widget::{ - Space, button, column, combo_box, container, row, rule, text, text_input, toggler, + Space, button, column, combo_box, container, row, rule, scrollable, text, text_input, toggler, }; use iced::{Background, Border, Center, Color, Length, Padding, Theme}; use log::error; @@ -507,7 +507,7 @@ pub fn airpods_view<'a>( } } - container(column![ + let content = container(column![ rename_input, Space::new().height(Length::from(20)), listening_mode, @@ -519,8 +519,10 @@ pub fn airpods_view<'a>( information_col ]) .padding(20) - .center_x(Length::Fill) - .height(Length::Shrink) + .center_x(Length::Fill); + + container(scrollable(content).height(Length::Fill)) + .height(Length::Fill) } fn run_async_in_thread(fut: F) diff --git a/linux-rust/src/ui/nothing.rs b/linux-rust/src/ui/nothing.rs index 19295ba9e..dad661061 100644 --- a/linux-rust/src/ui/nothing.rs +++ b/linux-rust/src/ui/nothing.rs @@ -5,7 +5,7 @@ use iced::border::Radius; use iced::overlay::menu; use iced::widget::combo_box; use iced::widget::text_input; -use iced::widget::{Space, column, container, row, text}; +use iced::widget::{Space, column, container, row, scrollable, text}; use iced::{Background, Border, Length, Theme}; use std::collections::HashMap; use std::sync::Arc; @@ -158,7 +158,7 @@ pub fn nothing_view<'a>( style }); - container(column![ + let content = container(column![ noise_control_mode, Space::new().height(Length::from(20)), container(information_col) @@ -174,8 +174,10 @@ pub fn nothing_view<'a>( .padding(20) ]) .padding(20) - .center_x(Length::Fill) - .height(Length::Shrink) + .center_x(Length::Fill); + + container(scrollable(content).height(Length::Fill)) + .height(Length::Fill) } fn run_async_in_thread(fut: F) diff --git a/linux-rust/src/ui/window.rs b/linux-rust/src/ui/window.rs index 47a2d39a0..c93ca947d 100644 --- a/linux-rust/src/ui/window.rs +++ b/linux-rust/src/ui/window.rs @@ -871,16 +871,12 @@ impl App { match state { DeviceState::AirPods(state) => { device_managers.get(id).and_then(|managers| { - managers.get_aacp().map(|aacp_manager| { - let view = airpods_view( - id, - &devices_list, - state, - aacp_manager.clone(), - ); - container(scrollable(view).height(Length::Fill)) - .height(Length::Fill) - }) + managers.get_aacp().map(|aacp_manager| airpods_view( + id, + &devices_list, + state, + aacp_manager.clone(), + )) }) } _ => None, @@ -897,9 +893,7 @@ impl App { if let Some(DeviceState::Nothing(state)) = device_state { if let Some(device_managers) = device_managers.get(id) { if let Some(att_manager) = device_managers.get_att() { - let view = nothing_view(id, &devices_list, state, att_manager.clone()); - container(scrollable(view).height(Length::Fill)) - .height(Length::Fill) + nothing_view(id, &devices_list, state, att_manager.clone()) } else { error!("No ATT manager found for Nothing device {}", id); container(