mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 14:00:09 +00:00
stylecontext: Remove state from _peek_style_property()
It evaluates to "current state" in all cases, so no need to special case it.
This commit is contained in:
parent
e51e8a28dd
commit
4a6957f50d
@ -1153,7 +1153,7 @@ gtk_style_get_style_property (GtkStyle *style,
|
||||
priv = GTK_STYLE_GET_PRIVATE (style);
|
||||
peek_value = _gtk_style_context_peek_style_property (priv->context,
|
||||
widget_type,
|
||||
0, pspec);
|
||||
pspec);
|
||||
|
||||
if (G_VALUE_TYPE (value) == G_PARAM_SPEC_VALUE_TYPE (pspec))
|
||||
g_value_copy (peek_value, value);
|
||||
@ -1214,7 +1214,7 @@ gtk_style_get_valist (GtkStyle *style,
|
||||
}
|
||||
|
||||
peek_value = _gtk_style_context_peek_style_property (priv->context, widget_type,
|
||||
0, pspec);
|
||||
pspec);
|
||||
G_VALUE_LCOPY (peek_value, var_args, 0, &error);
|
||||
if (error)
|
||||
{
|
||||
|
@ -244,7 +244,6 @@ struct PropertyValue
|
||||
{
|
||||
GType widget_type;
|
||||
GParamSpec *pspec;
|
||||
GtkStateFlags state;
|
||||
GValue value;
|
||||
};
|
||||
|
||||
@ -2182,9 +2181,6 @@ style_property_values_cmp (gconstpointer bsearch_node1,
|
||||
if (val1->pspec != val2->pspec)
|
||||
return val1->pspec < val2->pspec ? -1 : 1;
|
||||
|
||||
if (val1->state != val2->state)
|
||||
return val1->state < val2->state ? -1 : 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2200,7 +2196,6 @@ _gtk_style_context_peek_property (GtkStyleContext *context,
|
||||
const GValue *
|
||||
_gtk_style_context_peek_style_property (GtkStyleContext *context,
|
||||
GType widget_type,
|
||||
GtkStateFlags state,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkStyleContextPrivate *priv;
|
||||
@ -2210,10 +2205,9 @@ _gtk_style_context_peek_style_property (GtkStyleContext *context,
|
||||
|
||||
priv = context->priv;
|
||||
|
||||
data = style_data_lookup_for_state (context, state);
|
||||
data = style_data_lookup (context);
|
||||
|
||||
key.widget_type = widget_type;
|
||||
key.state = state;
|
||||
key.pspec = pspec;
|
||||
|
||||
/* need value cache array */
|
||||
@ -2246,7 +2240,7 @@ _gtk_style_context_peek_style_property (GtkStyleContext *context,
|
||||
|
||||
if (gtk_style_provider_get_style_property (GTK_STYLE_PROVIDER (priv->cascade),
|
||||
widget_path,
|
||||
state, pspec, &pcache->value))
|
||||
0, pspec, &pcache->value))
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
@ -2322,7 +2316,6 @@ gtk_style_context_get_style_property (GtkStyleContext *context,
|
||||
{
|
||||
GtkStyleContextPrivate *priv;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkStateFlags state;
|
||||
GParamSpec *pspec;
|
||||
const GValue *peek_value;
|
||||
GType widget_type;
|
||||
@ -2366,9 +2359,7 @@ gtk_style_context_get_style_property (GtkStyleContext *context,
|
||||
return;
|
||||
}
|
||||
|
||||
state = gtk_style_context_get_state (context);
|
||||
peek_value = _gtk_style_context_peek_style_property (context, widget_type,
|
||||
state, pspec);
|
||||
peek_value = _gtk_style_context_peek_style_property (context, widget_type, pspec);
|
||||
|
||||
if (G_VALUE_TYPE (value) == G_VALUE_TYPE (peek_value))
|
||||
g_value_copy (peek_value, value);
|
||||
@ -2397,7 +2388,6 @@ gtk_style_context_get_style_valist (GtkStyleContext *context,
|
||||
{
|
||||
GtkStyleContextPrivate *priv;
|
||||
const gchar *prop_name;
|
||||
GtkStateFlags state;
|
||||
GType widget_type;
|
||||
|
||||
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
|
||||
@ -2425,8 +2415,6 @@ gtk_style_context_get_style_valist (GtkStyleContext *context,
|
||||
}
|
||||
}
|
||||
|
||||
state = gtk_style_context_get_state (context);
|
||||
|
||||
while (prop_name)
|
||||
{
|
||||
GtkWidgetClass *widget_class;
|
||||
@ -2447,8 +2435,7 @@ gtk_style_context_get_style_valist (GtkStyleContext *context,
|
||||
break;
|
||||
}
|
||||
|
||||
peek_value = _gtk_style_context_peek_style_property (context, widget_type,
|
||||
state, pspec);
|
||||
peek_value = _gtk_style_context_peek_style_property (context, widget_type, pspec);
|
||||
|
||||
G_VALUE_LCOPY (peek_value, args, 0, &error);
|
||||
|
||||
|
@ -36,7 +36,6 @@ GtkCssValue * _gtk_style_context_peek_property (GtkStyleContext *c
|
||||
guint property_id);
|
||||
const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context,
|
||||
GType widget_type,
|
||||
GtkStateFlags state,
|
||||
GParamSpec *pspec);
|
||||
void _gtk_style_context_validate (GtkStyleContext *context,
|
||||
gint64 timestamp,
|
||||
|
@ -13018,14 +13018,12 @@ gtk_widget_style_get_property (GtkWidget *widget,
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
const GValue *peek_value;
|
||||
GtkStateFlags state;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
state = gtk_widget_get_state_flags (widget);
|
||||
|
||||
peek_value = _gtk_style_context_peek_style_property (context,
|
||||
G_OBJECT_TYPE (widget),
|
||||
state, pspec);
|
||||
pspec);
|
||||
|
||||
/* auto-conversion of the caller's value type
|
||||
*/
|
||||
@ -13059,14 +13057,12 @@ gtk_widget_style_get_valist (GtkWidget *widget,
|
||||
va_list var_args)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
GtkStateFlags state;
|
||||
const gchar *name;
|
||||
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
g_object_ref (widget);
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
state = gtk_widget_get_state_flags (widget);
|
||||
|
||||
name = first_property_name;
|
||||
while (name)
|
||||
@ -13091,7 +13087,7 @@ gtk_widget_style_get_valist (GtkWidget *widget,
|
||||
|
||||
peek_value = _gtk_style_context_peek_style_property (context,
|
||||
G_OBJECT_TYPE (widget),
|
||||
state, pspec);
|
||||
pspec);
|
||||
|
||||
G_VALUE_LCOPY (peek_value, var_args, 0, &error);
|
||||
if (error)
|
||||
|
Loading…
Reference in New Issue
Block a user