Adding a tooltip to VolumeSlider
Review Request #123121 - Created March 24, 2015 and submitted
|Ronnie P. Thomas|
This patch adds a tooltip to the VolumeSlider, which shows the current value of the slider in percentage. The tooltip is shown only when the slider handle is selected, and it changes its value dynamically when the slider is moved from its current position.
Possible implementation of bug 320949.
Tested for both horizontal and vertical orientation of the slider.
Thanks for your patch.
It looks fine. It is also less intrusive than a permanently (actually I presume that it is permanenz) shown percentage, as the patch proposal on https://bugs.kde.org/show_bug.cgi?id=320949 , so I would say we should go for it.
I would like a bit more spacing, so I added it. But apart from that the patch is fine. Two comments though for future developers:
1) The patch operates on the value of one individual channel slider, and thus is representing only the value of that channel. This is technically not 100% sound for a corner case: The average of all channels should be displayed, as given by the "underlying" Volume class. On the other hand, in "joined slider mode", the slider should already represent the average of all channels. And as soon as you move the slider, all channels are changed. So it is likely really exact enough.
2) Future directions: It would be better to do the percentage calculation via the Volume class, as it handles corner cases like muting. But due to "auto-unmuting" the value is factually also correct. As there is no pointer/reference to the "underlying" Volume object in the MDWSlider, I would say: Just keep it like this.