GNOME Bugzilla – Bug 665140
Draw the scale split
Last modified: 2011-12-14 16:22:16 UTC
As in Gtk+2, the scale can be split. This patch adds a property to GtkScale, and APIs to set and get it. Also, the GtkRange's drawing code was modified accordingly.
Created attachment 202383 [details] [review] Fix for the issue
Created attachment 202388 [details] [review] Take 2
Review of attachment 202388 [details] [review]: Looks generally good, some comments below. ::: gtk/gtkrange.c @@ +2127,3 @@ + /* FIXME: was trough-upper and trough-lower really used, + * in that case, it should still be exposed somehow. + */ This FIXME can be removed now ::: gtk/gtkscale.c @@ +92,2 @@ guint draw_value : 1; + guint has_origin : 1; You can probably use the member in GtkRange itself directly...no need to duplicate it here. @@ +720,3 @@ + * + * Specifies whether the scale has an origin. + */ Missing Since: 3.4. @@ +751,3 @@ + * Returns whether the scale has an origin. + * + * Returns: whether the scale has an origin. ...%TRUE if the scale has an origin. Also, it's not really explained what it means for a scale to have an origin.
Created attachment 202390 [details] [review] Take 3
For the vertical one, just .trough.highlight.bottom could match the "colored" area, as .highlight is only set for the bottom element
Review of attachment 202390 [details] [review]: This looks good for master to me, with the following nitpick to be fixed before. ::: gtk/gtkscale.c @@ +517,3 @@ break; + case PROP_HAS_ORIGIN: + g_value_set_boolean (value, _gtk_range_get_has_origin (GTK_RANGE (scale))); Use gtk_scale_get_has_origin() instead of _gtk_range_get_has_origin() here.
Created attachment 203350 [details] [review] Implemented cosimo's suggestion
Review of attachment 203350 [details] [review]: Fine to commit after fixing the typo ::: gtk/gtkscale.c @@ +517,3 @@ break; + case PROP_HAS_ORIGIN: + g_value_set_boolean (value, gtk_scake_get_has_origin (GTK_RANGE (scale))); Typo: scale
Created attachment 203351 [details] [review] Fixes typo ops
Pushed on Andrea's behalf; I also added the new APIs to gtk.symbols and gtk3-sections.txt.