fix(ui): keep the Leave button reachable on a short window (A12)
The controls column (mute/deafen/PTT/echo/record/share/Leave) had no scroll, so on a short window the bottom of it — including Leave — was clipped with no way to reach it; the only workaround was enlarging the window. At a small enough size you couldn't exit the call through the UI at all. Fix: pin Leave at the bottom of the control panel and wrap the controls above it in a scrollable (height Fill). The controls now scroll when the window is too short, and Leave (the exit control) is always visible. Applies to all three room layouts (control_panel is Fill-height in every arm). Build + clippy clean. Manual check: create a room, shrink the window — Leave stays put, controls scroll. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+16
-8
@@ -1834,22 +1834,30 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
|
||||
share_btn = share_btn.on_press(AppMessage::ToggleScreenShare);
|
||||
}
|
||||
share_btn
|
||||
},
|
||||
vertical_space(30.0),
|
||||
button(btn_content(IconKind::Leave, "Leave Room", color_crust))
|
||||
}
|
||||
];
|
||||
|
||||
// Leave is the exit control, so it's pinned below the scrolling controls
|
||||
// (built separately, outside `ctrl_buttons`) — see the panel assembly (A12).
|
||||
let leave_btn = button(btn_content(IconKind::Leave, "Leave Room", color_crust))
|
||||
.on_press(AppMessage::LeavePressed)
|
||||
.style(b_style(color_red, color_maroon, color_crust, 8.0))
|
||||
.padding(14)
|
||||
.width(iced::Length::Fill)
|
||||
];
|
||||
.width(iced::Length::Fill);
|
||||
|
||||
// Controls panel — width is set per layout below.
|
||||
// Controls panel — width is set per layout below. The controls SCROLL when
|
||||
// the window is too short, and Leave stays pinned at the bottom so the exit
|
||||
// control is always reachable instead of being clipped off-screen (A12).
|
||||
let control_panel = container(
|
||||
column![
|
||||
text("Controls").size(18).color(color_blue),
|
||||
vertical_space(15.0),
|
||||
ctrl_buttons,
|
||||
vertical_space(20.0),
|
||||
scrollable(ctrl_buttons)
|
||||
.width(iced::Length::Fill)
|
||||
.height(iced::Length::Fill),
|
||||
vertical_space(12.0),
|
||||
leave_btn,
|
||||
vertical_space(8.0),
|
||||
text(&state.status_message).size(12).color(color_subtext)
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user