GNOME Bugzilla – Bug 351755
GTK_RANGE (range) -> round_digits should be exposed as a property
Last modified: 2011-01-15 05:09:20 UTC
Please describe the problem: GtkRange has a member variable called "round_digits" that rounds the value to a certain abount of digits. In particular if round_digits = 0 the Range enables a "stepping" behaviour for GtkScale, which is IMHO very useful for some applications. IMHO this should be exposed better in the API, at least don't hide this feature in the documentation for the "change-value" signal, maybe even make a real property for it. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
This actually needs public API now that it's sealed. The private member is still documented.
Created attachment 178226 [details] [review] Property and accessors for GtkRange::round_digits
Review of attachment 178226 [details] [review]: Only some minor comments about gtk-doc notation ::: gtk/gtkrange.c @@ +389,3 @@ * the ::change-value signal is responsible for clamping the value to * the desired number of decimal digits; the default GTK+ handler + * clamps the value based on "round-digits". You can use #GtkRange:round-digits here @@ +501,3 @@ + * + * Sets the number of widgets to round the value to when + * it changes. See ::change-value. #GtkRange::change-value @@ +4087,3 @@ + * + * Sets the number of widgets to round the value to when + * it changes. See ::change-value. #GtkRange::change-value @@ +4107,3 @@ + * + * Sets the number of widgets to round the value to when + * it changes. See ::change-value. #GtkRange::change-value
A minumin property value of -G_MAXINT doesn't make sense here, it should be 0.
Created attachment 178231 [details] [review] 178226: Property and accessors for GtkRange::round_digits #2 Thanks for the quick comments! I fixed the property and signal syntax, including the already present signal names in the change-value signal. Mitch, I actually realised -1 should be minimum and default here, the spin button actually uses that to unset the value. I added a return_if_fail as well for that.
"Sets the number of widgets to round to" is a funny typo