gui: scroll the host body and grow the default window for the QR
The QR panel pushed the Stop hosting button below the fold at the old 520x480 default. Wraps host_running/host_form in a vertical ScrollArea (header stays pinned) and bumps the initial height to 640 so the common case fits without scrolling. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+15
-7
@@ -66,8 +66,11 @@ use winit::window::{Window, WindowAttributes, WindowId};
|
|||||||
use self::child::{ChildEvent, ChildProc};
|
use self::child::{ChildEvent, ChildProc};
|
||||||
use self::tray::{TrayAction, TrayHandle, TrayStatus};
|
use self::tray::{TrayAction, TrayHandle, TrayStatus};
|
||||||
|
|
||||||
/// Initial / minimum window size, in logical points.
|
/// Initial / minimum window size, in logical points. Initial height fits the
|
||||||
const INNER_SIZE: [f64; 2] = [520.0, 480.0];
|
/// host screen (ticket + Copy + QR + Stop) without needing to scroll on a 1080p
|
||||||
|
/// display; the host screen still wraps in a ScrollArea for the case where the
|
||||||
|
/// user shrinks the window below MIN_INNER_SIZE proportions.
|
||||||
|
const INNER_SIZE: [f64; 2] = [520.0, 640.0];
|
||||||
const MIN_INNER_SIZE: [f64; 2] = [460.0, 380.0];
|
const MIN_INNER_SIZE: [f64; 2] = [460.0, 380.0];
|
||||||
|
|
||||||
/// Events delivered to the winit loop from off the UI thread (or from egui).
|
/// Events delivered to the winit loop from off the UI thread (or from egui).
|
||||||
@@ -959,11 +962,16 @@ impl PixelPassApp {
|
|||||||
});
|
});
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|
||||||
if running {
|
// Scroll the body, not the header — Menu/Host stay pinned at the top.
|
||||||
self.host_running(ui);
|
// Needed once the QR panel landed: ticket + Copy + QR + Stop overflows a
|
||||||
} else {
|
// shrunken window.
|
||||||
self.host_form(ui);
|
egui::ScrollArea::vertical().show(ui, |ui| {
|
||||||
}
|
if running {
|
||||||
|
self.host_running(ui);
|
||||||
|
} else {
|
||||||
|
self.host_form(ui);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn host_form(&mut self, ui: &mut egui::Ui) {
|
fn host_form(&mut self, ui: &mut egui::Ui) {
|
||||||
|
|||||||
Reference in New Issue
Block a user