From f74ed3836336cd04c60bcb610628ca114b698c54 Mon Sep 17 00:00:00 2001 From: Maciek <108873945+rozwader@users.noreply.github.com> Date: Tue, 25 Aug 2026 15:20:46 +0200 Subject: [PATCH] fix: scrollbar obscuring the file path (#741) --- .../src/view/app/settings/java.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/oneclient_app/src/view/app/settings/java.rs b/packages/oneclient_app/src/view/app/settings/java.rs index 77449666..7671ec55 100644 --- a/packages/oneclient_app/src/view/app/settings/java.rs +++ b/packages/oneclient_app/src/view/app/settings/java.rs @@ -203,6 +203,13 @@ impl Component for RuntimeRow { let runtime = &self.runtime; let path = runtime.absolute_path.clone(); + // so the scrollarea becomes bigger when horizontal scroll bar is visible (then it won't obscure the file path) + let mut viewport_w = use_state(|| 0f32); + let content_w = path_content_width(&runtime.absolute_path); + let measured_w = *viewport_w.read(); + let has_scrollbar = measured_w <= 0. || measured_w < content_w; + let path_height = if has_scrollbar { 28. } else { 18. }; + fn cell(text: String, width: Size) -> impl IntoElement { rect() .width(width) @@ -240,12 +247,19 @@ impl Component for RuntimeRow { .child( rect() .width(Size::flex(1.0)) + .height(Size::px(path_height)) .overflow(Overflow::Clip) + .on_sized(move |e: Event| { + let w = e.area.width(); + if (*viewport_w.read() - w).abs() > 0.5 { + viewport_w.set(w); + } + }) .child( ScrollArea::new() - .horizontal(path_content_width(&runtime.absolute_path)) + .horizontal(content_w) .width(Size::fill()) - .height(Size::px(18.)) + .height(Size::px(path_height)) .show_scrollbar(false) .child( label()