From 986b83280fb9e23385fc076398b14b7ed3b57859 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 10 Oct 2026 02:32:27 +0700 Subject: [PATCH] Fix #808: the toolbar's scroll bar stays a slim line The toolbar and the dock's icon column scroll when the window is too short for them. Their scroll bar was egui's floating one, which widens to 10 pt while scrolled or dragged and covered the group labels and the icons' right edge. It now stays at most 4 pt wide (2 pt at rest), at the column's edge. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/widgets.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 28c6c35b..86cf5982 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -785,8 +785,20 @@ pub fn menu_scroll(ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> R /// A column of tool or panel buttons (the toolbar, the dock's icon column) that scrolls when the /// window is too short for it: with the mouse wheel, or the scroll bar shown while the pointer is /// over it. +/// Its scroll bar stays a slim line at the edge, even while scrolled or dragged, so it never covers +/// the buttons (#808). pub fn strip_scroll(ui: &mut Ui, id: &str, add_contents: impl FnOnce(&mut Ui) -> R) -> R { - egui::ScrollArea::vertical().id_salt(id).auto_shrink([false, true]).show(ui, add_contents).inner + ui.scope(|ui| { + ui.spacing_mut().scroll = egui::style::ScrollStyle { + bar_width: 4.0, + floating_width: 2.0, + bar_inner_margin: 0.0, + bar_outer_margin: 1.0, + ..egui::style::ScrollStyle::floating() + }; + egui::ScrollArea::vertical().id_salt(id).auto_shrink([false, true]).show(ui, add_contents).inner + }) + .inner } /// Whether the blend-mode list draws a separator above `BlendMode::ALL[i]`: where a