Remove GtkRange::stepper-position-details

This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
This commit is contained in:
Matthias Clasen
2010-09-01 21:48:44 -04:00
parent 658f99b8ee
commit d28af9cbb9

View File

@ -597,21 +597,6 @@ gtk_range_class_init (GtkRangeClass *class)
0.0, 1.0, 0.5, 0.0, 1.0, 0.5,
GTK_PARAM_READABLE)); GTK_PARAM_READABLE));
/**
* GtkRange:stepper-position-details:
*
* When %TRUE, the detail string for rendering the steppers will be
* suffixed with information about the stepper position.
*
* Since: 2.22
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boolean ("stepper-position-details",
P_("Stepper Position Details"),
P_("When TRUE, the detail string for rendering the steppers is suffixed with position information"),
FALSE,
GTK_PARAM_READABLE));
g_type_class_add_private (class, sizeof (GtkRangePrivate)); g_type_class_add_private (class, sizeof (GtkRangePrivate));
} }
@ -1731,26 +1716,14 @@ gtk_range_get_stepper_detail (GtkRange *range,
GtkRangePrivate *priv = range->priv; GtkRangePrivate *priv = range->priv;
const gchar *stepper_detail; const gchar *stepper_detail;
gboolean need_orientation; gboolean need_orientation;
gboolean need_position; gchar *detail;
const gchar *position = NULL;
if (priv->stepper_detail_quark[stepper]) if (priv->stepper_detail_quark[stepper])
return g_quark_to_string (priv->stepper_detail_quark[stepper]); return g_quark_to_string (priv->stepper_detail_quark[stepper]);
stepper_detail = GTK_RANGE_GET_CLASS (range)->stepper_detail; stepper_detail = GTK_RANGE_GET_CLASS (range)->stepper_detail;
need_orientation = stepper_detail && stepper_detail[0] == 'X';
gtk_widget_style_get (GTK_WIDGET (range),
"stepper-position-details", &need_position,
NULL);
if (need_orientation || need_position)
{
gchar *detail;
const gchar *position = NULL;
if (need_position)
{
switch (stepper) switch (stepper)
{ {
case STEPPER_A: case STEPPER_A:
@ -1774,11 +1747,10 @@ gtk_range_get_stepper_detail (GtkRange *range,
default: default:
g_assert_not_reached (); g_assert_not_reached ();
} }
}
detail = g_strconcat (stepper_detail, position, NULL); detail = g_strconcat (stepper_detail, position, NULL);
if (need_orientation) if (detail[0] == 'X')
detail[0] = priv->orientation == GTK_ORIENTATION_HORIZONTAL ? 'h' : 'v'; detail[0] = priv->orientation == GTK_ORIENTATION_HORIZONTAL ? 'h' : 'v';
priv->stepper_detail_quark[stepper] = g_quark_from_string (detail); priv->stepper_detail_quark[stepper] = g_quark_from_string (detail);
@ -1788,9 +1760,6 @@ gtk_range_get_stepper_detail (GtkRange *range,
return g_quark_to_string (priv->stepper_detail_quark[stepper]); return g_quark_to_string (priv->stepper_detail_quark[stepper]);
} }
return stepper_detail;
}
static void static void
draw_stepper (GtkRange *range, draw_stepper (GtkRange *range,
Stepper stepper, Stepper stepper,