From 046860ad1c974ec8d8927584d787d6e46be6c2b4 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Tue, 24 Nov 2026 00:16:09 +0100 Subject: [PATCH] app: scroll the log box and give it more height Two hundred lines of log did not fit the card, so the text ran past the card's edge. The box is a scroll viewport now, 440 points tall, pinned to its newest line until the reader scrolls, with its own bar in the strip the padding leaves. It sits inside the settings scroller, so both bars share the screen and the log takes the wheel while the pointer is over it. --- app/src/app.rs | 7 +++++++ app/src/screens/settings.rs | 31 +++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/app/src/app.rs b/app/src/app.rs index 94b6430..25ece54 100644 --- a/app/src/app.rs +++ b/app/src/app.rs @@ -183,6 +183,7 @@ pub struct App { pub highlights_scroll: ui::ScrollBar, pub events_scroll: ui::ScrollBar, pub recording_scroll: ui::ScrollBar, + pub log_scroll: ui::ScrollBar, pub notice: Option, /// ffmpeg being downloaded on the first run, and the whole percent it last reported. pub ffmpeg_rx: Option>, @@ -246,6 +247,7 @@ impl App { highlights_scroll: ui::ScrollBar::new(), events_scroll: ui::ScrollBar::new(), recording_scroll: ui::ScrollBar::new(), + log_scroll: ui::ScrollBar::new(), notice: None, ffmpeg_rx: None, ffmpeg_pct: None, @@ -1469,6 +1471,11 @@ pub fn view(app: &App, cx: &mut Cx) -> El { "recording-thumb", "recording-scroller", )), + // The Advanced tab puts the log box inside the settings scroller, so it draws a second + // thumb, and only while that tab is up: the box leaves the window with the tab. + Screen::Settings if app.settings_tab == SettingsTab::Advanced => window + .child(app.scroll.thumb(p, "scroll-thumb", "scroller")) + .child(app.log_scroll.thumb(p, "log-thumb", "log-scroller")), Screen::Settings => window.child(app.scroll.thumb(p, "scroll-thumb", "scroller")), Screen::History => window.child(app.scroll.thumb(p, "scroll-thumb", "list-scroller")), // A clip fills its screen with a player, not a list: the history or settings thumb would diff --git a/app/src/screens/settings.rs b/app/src/screens/settings.rs index 307aaa7..f8f9966 100644 --- a/app/src/screens/settings.rs +++ b/app/src/screens/settings.rs @@ -1081,16 +1081,27 @@ fn advanced(app: &App, p: Paint, kit: &rune_kit::Kit, layer: &mut Vec, conte p, Some("Log"), vec![ - col().key("log").padding(space::S3).h(300.0).gap(0.0).child( - text(if app.logs.is_empty() { - "No log loaded. Press Reload log." - } else { - &app.logs - }) - .key("log-text") - .font(type_::MONO_CAPTION) - .color(p.muted()) - .w_full(), + app.log_scroll.follow( + "log-scroller", + col() + .key("log") + .padding(space::S3) + // Room for the scroll bar the box draws at the viewport's end edge. + .pr(14.0) + .h(440.0) + .gap(0.0) + .scroll(rune::ScrollSpec { stick_bottom: true }) + .child( + text(if app.logs.is_empty() { + "No log loaded. Press Reload log." + } else { + &app.logs + }) + .key("log-text") + .font(type_::MONO_CAPTION) + .color(p.muted()) + .w_full(), + ), ), ], ))