Tray: split rate/plot columns, add unit toggle to the devices window

The connected-peers rate and sparkline shared one grid cell, so the plot still
moved right as the rate text grew (e.g. "1.0 kB/s"). They are now two separate
grid columns — the plot column starts at the same x on every row, since grid
columns align.

The devices window also gets its own pkts/bytes toggle, bound to the same unit
setting as the main window so the two stay in step.

Builds and is clippy-clean (-D warnings) on macOS; not run in this headless
session.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
UltradesuandClaude Opus 4.8 committed 2026-10-02 16:04:39 +01:00
1 parent db01c58a6f
commit 2a0a8abd60
2 files changed
+23 -14

No files matched your search

+3 -1
View File
@@ -99,7 +99,6 @@ impl App {
let Some(Ok(report)) = &snapshot.status else {
return;
};
let unit = self.state.unit;
let open: Vec<String> = self.state.open_devices.iter().cloned().collect();
for id in open {
let Some(network) = report.networks.iter().find(|n| n.network_id == id) else {
@@ -114,6 +113,9 @@ impl App {
.with_min_inner_size([480.0, 320.0]);
let agent = &self.agent;
let traffic = &self.traffic;
// The window shares the single unit setting, so its toggle and the
// main window's stay in step.
let unit = &mut self.state.unit;
let keep = ctx.show_viewport_immediate(viewport_id, builder, |vctx, _class| {
devices::show(vctx, agent, unit, network, traffic);
!vctx.input(|i| i.viewport().close_requested())