feat(AudioPanel): volume change on mouse wheel#2199
feat(AudioPanel): volume change on mouse wheel#2199koffydrop wants to merge 7 commits intonoctalia-dev:mainfrom
Conversation
|
This is not quite right, the right approach would be to add a onWheel signal in NSlider and use that appropriately. |
|
I'll give it shot, if I can't figure it out I'll let you know |
|
@ItsLemmy how does this look? I'm not sure why jumping from 4.5.0 to 4.6.8 makes the sink and source volumes not follow the volume step if it changes too fast, but application audio works as expected |
|
I don't know either, all I know is PW does not like to receive a bunch of volume changes in a small time frame, as they have some quick fade implemented somewhere. That's why we usually debounce calls. |
|
Gotcha. In that case this should be good for review, unless you prefer if I squash into a single commit |
|
|
The layout warning actually goes away after moving the MouseArea to NSlider, and |
|
No this was only a workaround to avoid the warning, if it's gone keep it simple with the original syntax. |
if the user configured a volume step of 1%, sometimes the check to sync only when the volume changed would erroneously be false, as the change it detects would be something like `0.0099... >= 0.01`
I used the local*VolumeChanging variables and a timer to reset them after 100ms without wheel input, so now the text should display the correct volume before syncing to pipewire. Also with a volume step of 1 sometimes the sliders don't register a change due to float precision, and makes it impossible to stop at certain values without closing their respective panels first. I rounded the checks to account for that, hope that's alright. If you can think of other sliders that could use this I can look into them as well. |
|
Testing now on 4.7.1 day-to-day, no apparent issues so far |

Pull Request
Motivation
Previously you could not adjust volumes with the mouse wheel on the volume widget, despite being able to in the control center, which annoyed me to no end.
This works on inputs, outputs and, per application audio.
Type of Change
Testing
Just regular day-to-day use.
Screenshots / Videos
Checklist
Additional Notes
I just copied and adapted the code from AudioCard. Not sure if there's more that needs to be considered.
I'm also testing it on version 4.5.0 which is the one packaged in nixpkgs at the moment, but I made sure to check it does work on main with noctalia-qs.
This introduces this warning, which I'm not sure how to fix without breaking functionality.