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(), + ), ), ], ))