Skip to content
  • Daniel Boles's avatar
    Scale: Always sync ::digits to Range::round-digits · 4a6bd134
    Daniel Boles authored
    The documents state that gtk_scale_set_digits() “causes the value of the
    adjustment to be rounded off to this number of digits, so the retrieved
    value matches the value the user saw.” Note the lack of any condition.
    
    But in fact, if draw-value was false, rounding was disabled on the base
    Range, so values that weren’t displayed weren’t rounded. This made the
    docs wrong and made an apparently cosmetic detail alter functionality.
    
    Fix by ensuring the number of digits set on Scale is always propagated
    along to gtk_range_set_round_digits(), thus rounding to it in all cases
    when the value changes, regardless of whether the value is displayed.
    
    This doesn’t address the other idea from Bugzilla: that changing the
    number of digits should clamp the _existing_ value if it’s more precise.
    This contradicts digits docs in the base Range, but the above from Scale
    can be read as implying it’ll happen. For now, that’s an open question.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=358970
    4a6bd134