GNOME Bugzilla – Bug 621250
Missing accessors for GtkRange has_stepper_X
Last modified: 2010-06-27 01:12:14 UTC
Probably want to turn this into a bitfield, or use an enum. Either: gtk_range_has_stepper (GtkRange, GtkStepperType type) or bitfield gtk_range_get_has_stepper (GtkRange) It's needed for engine theme that want to display the steppers differently.
The only range widgets where steppers are configurable are scrollbars, and they do have style properties for this.
Hm, the usecase is code that tries to figure out what stepper is drawn. We could use the scrollbars style properties there, to replace the current code. I wonder how this could be done in a saner way. The engines usually want to just know the position of the stepper, to draw nice rounded corners on the ones at the top/bottom. This could be done by adding something simple to the detail string.
sounds like something we would typically solve by a detail string + opt-in style property, indeed.
Created attachment 164389 [details] [review] Implement GtkRange:stepper-position-details So you probably want something like this, so "trough" is suffixed with "-a", b, c or d according to the stepper, if you set stepper-position-details to TRUE. I noticed there is trough-side-details already, can we assume it to be set in this context? I didn't attempt to modify any engines, the local expert needs to see if it does the job :-)
Review of attachment 164389 [details] [review]: Looks good to me, apart from the one issue below. ::: gtk/gtkrange.c @@ +1977,3 @@ + gtk_widget_style_get (widget, "stepper-position-details", + &stepper_position_details, NULL); + if (stepper_detail) You mean if (stepper_position_details) here, I' sure...
Review of attachment 164389 [details] [review]: ::: gtk/gtkrange.c @@ +1977,3 @@ + gtk_widget_style_get (widget, "stepper-position-details", + &stepper_position_details, NULL); + if (stepper_detail) Also, more importantly, you are modifying the wrong paint calls here. We need to change draw_stepper() instead. @@ +1986,3 @@ + stepper_detail = "trough-c"; + else if (range->has_stepper_d) + stepper_detail = "trough-d"; Finally, the comment from Benjamin was that it would be better to make the detail contain some context information, like "hscrollbar-stepper-backward", "vscrollbar-stepper-secondary-forward", and so on. To match the scrollbar style properties for turning these on and off. It might be nice to do this in gtk_range_get_stepper_detail()
I've now done this. The detail strings are now [hv]scrollbar_start [hv]scrollbar_middle [hv]scrollbar_end