GNOME Bugzilla – Bug 781605
GtkVolumeButton limited to 10 values
Last modified: 2017-05-01 09:18:07 UTC
Since https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4a6bd134bdc192b4830a1c6228e27332d4629418 GtkVolumeButton can only represent 10 different values when dragging with the mouse. 1) Open gtk3-widget-factory 2) Go to page 2 3) Click the volume button in the top left corner 4) Click and drag the slider Expected: No value rounding Actual: The slider knob snaps to one of 10 values Reverting the above commit fixes the problem.
The same problem affects the color chooser and the font size chooser (which limits the colors, font sizes one can select..) Solutions: 1) Disable rounding only for GtkScaleButton, GtkColorChooser and GtkFontChooser 2) Disable rounding of GtkScale by default (set digits default value from 1 to -1) 3) Revert the patch for 3.22 and change default only in master
Created attachment 350258 [details] [review] gtkscale: disable value rounding by default Before 4a6bd134bdc192b483 GtkScale did not round values if no value was shown and many widgets using GtkScaleButton and GtkScale like GtkVolumeButton, GtkColorEditor and GtkFontChooserWidget implicitly depended on this behavior. This broke selecting specific colors, font sizes and volume levels. This restores the previous behavior of the common case by disabling rounding by default for all cases. The removal of the round_digits value in GtkScaleButton is needed because before 4a6bd134bdc192b483 this value was ignored/reset by GtkScale and removing it restores the previous default behavior.
I'm sorry if that patch has caused any issues and will let everyone else decide on the best solution - including reverting if my judgment wasn't good here. Isn't there an option 4, though? Set a number of digits more than the default 1 on the Scalebutton etc cases. I've not looked into it yet but presumably e.g. the ScaleButton runs from 0 to 1 and the current number of digits == 1 causes the 10-step behaviour. Why not bump that to 2 digits or something? May be an option.
And perhaps an option 5? Leave Scale's default at 1 for rounding to 1 digit, and explicitly pass -1 from ScaleButton et al.
The commit was reverted, so closing this. https://git.gnome.org/browse/gtk+/commit/?id=197355e15ac10bc05b7eed34c9eae6fa33b9f5c4
Please could someone also apply the behavioural and documentation reverts to the gtk-2-24 branch? So that it will not cause problems in the next release (it was done since the previous one). I am on a rubbish internet connection and computer for the next while, so it might take me an age to get this done. Thanks.
> Please could someone also apply the behavioural and documentation reverts to the gtk-2-24 branch? Done
Thank you!