ui.scroll-width has no effect since the floem rewrite
Lapce Version
0.4.6, built from master (c9e4c339)
System information
Windows 10 Enterprise LTSC 1809 on a touch panel; also seen on Windows 11 Pro
Describe the bug
The ui.scroll-width setting has no effect. It appears in the settings dialog
with the description "Set the width for scroll bar", defaults/settings.toml
gives it a value of 10, and changing it — to 60, for instance — changes
nothing at all.
Additional information
The setting is never read. UIConfig provides getters for scale,
font_size, font_family, header_height, icon_size, status_height and
palette_width, but none for scroll_width, and the field itself is private.
Every other occurrence of scroll_width in the tree is an unrelated local
variable in plugin.rs.
The width is fixed in two places instead:
paint_scroll_barinlapce-app/src/editor/view.rsusesconst BAR_WIDTH: f64 = 10.0, which positions the separator line and the git change markers- floem's scroll handle and track keep their default
Thicknessof 10px, because the editor's scroll view never sets it
This is a regression. Before the floem rewrite the setting worked:
lapce-ui/src/scroll.rs sized the bars from it (lines 422 and 464), and
config.ui.scroll_width() existed. Both went away with 774008f5
("remove lapce-data and lapce-ui", 10 Aug 2023) — the setting stayed behind.
That also means the resolution of #1220 ("Scroll bars too narrow") is effectively gone. On a touch screen a 10px bar is genuinely hard to hit, which is what that issue was about.
I have a fix ready and would be happy to open a PR: re-add the getter, feed it
to floem's handle and track thickness as well as to paint_scroll_bar, and
keep 10px as the fallback when the value is zero. Tested on a touch panel —
with the setting honoured, the bar is comfortably draggable with a finger
again, and the git change markers scale with it.
Source: lapce/lapce