repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

fix(audio): map slider click to 0–150% scale, matching fill

9b51664792539b3a59fdebe0599a5681de7c6a1a

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

The volume track renders fill across a 0–150% range (fill = width *
percent/150) but click/drag mapped event.x/width as 0–100%, so the
thumb landed left of the cursor and 100% was unreachable by click.
Multiply the click ratio by 1.5 — the algebraic inverse of the fill
scale. Media seek stays 0–1 (unchanged).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Changed files (1)

+4 / −4 text lines

Diff layout

quickshell/nuguland/PopoutHost.qml

Modified

+4 / −4 text lines

39103910 MouseArea {
39113911 anchors.fill: parent
39123912 onClicked: (event) => {
3913 return root.setVolume(sinkRow.modelData.id, event.x / Math.max(1, width));
3913 return root.setVolume(sinkRow.modelData.id, event.x / Math.max(1, width) * 1.5);
39153915 onPositionChanged: (event) => {
39163916 if (pressed)
3917 root.setVolume(sinkRow.modelData.id, event.x / Math.max(1, width));
3917 root.setVolume(sinkRow.modelData.id, event.x / Math.max(1, width) * 1.5);
40544054 MouseArea {
40554055 anchors.fill: parent
40564056 onClicked: (event) => {
4057 return root.setVolume(sourceRow.modelData.id, event.x / Math.max(1, width));
4057 return root.setVolume(sourceRow.modelData.id, event.x / Math.max(1, width) * 1.5);
40594059 onPositionChanged: (event) => {
40604060 if (pressed)
4061 root.setVolume(sourceRow.modelData.id, event.x / Math.max(1, width));
4061 root.setVolume(sourceRow.modelData.id, event.x / Math.max(1, width) * 1.5);