After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 621250 - Missing accessors for GtkRange has_stepper_X
Missing accessors for GtkRange has_stepper_X
Product: gtk+
Classification: Platform
Component: Widget: Other
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks: 597610 612486
Reported: 2010-06-10 21:29 UTC by Bastien Nocera
Modified: 2010-06-27 01:12 UTC
See Also:
GNOME target: 3.0
GNOME version: ---

Implement GtkRange:stepper-position-details (2.70 KB, patch)
2010-06-23 12:22 UTC, Christian Dywan
needs-work Details | Review

Description Bastien Nocera 2010-06-10 21:29:25 UTC
Probably want to turn this into a bitfield, or use an enum.

gtk_range_has_stepper (GtkRange, GtkStepperType type)
bitfield gtk_range_get_has_stepper (GtkRange)

It's needed for engine theme that want to display the steppers differently.
Comment 1 Matthias Clasen 2010-06-14 22:05:41 UTC
The only range widgets where steppers are configurable are scrollbars, and they do have style properties for this.
Comment 2 Benjamin Berg 2010-06-15 09:08:58 UTC
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.
Comment 3 Matthias Clasen 2010-06-15 12:05:18 UTC
sounds like something we would typically solve by a detail string + opt-in style property, indeed.
Comment 4 Christian Dywan 2010-06-23 12:22:55 UTC
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 :-)
Comment 5 Matthias Clasen 2010-06-23 14:37:53 UTC
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...
Comment 6 Matthias Clasen 2010-06-24 13:57:17 UTC
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()
Comment 7 Matthias Clasen 2010-06-27 01:12:14 UTC
I've now done this.

The detail strings are now