[gtk+/wip/cosimoc/range-gadget: 11/21] range: use newer GtkCssGadget API
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cosimoc/range-gadget: 11/21] range: use newer GtkCssGadget API
- Date: Mon, 22 Feb 2016 03:46:07 +0000 (UTC)
commit a831bf48b00eee66177e96f1d101f07178d02904
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sat Jan 16 16:27:24 2016 -0800
range: use newer GtkCssGadget API
gtk/gtkrange.c | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index b7a213e..4c2d270 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -772,15 +772,15 @@ gtk_range_init (GtkRange *range)
NULL,
NULL,
NULL, NULL);
+ gtk_css_gadget_set_state (priv->trough_gadget,
+ gtk_css_node_get_state (widget_node));
gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->trough_gadget), widget_node);
- gtk_css_node_set_state (gtk_css_gadget_get_node (priv->trough_gadget),
- gtk_css_node_get_state (widget_node));
priv->slider_gadget = gtk_builtin_icon_new ("slider",
GTK_WIDGET (range),
priv->trough_gadget, NULL);
- gtk_css_node_set_state (gtk_css_gadget_get_node (priv->slider_gadget),
- gtk_css_node_get_state (widget_node));
+ gtk_css_gadget_set_state (priv->slider_gadget,
+ gtk_css_node_get_state (widget_node));
/* Note: Order is important here.
* The ::drag-begin handler relies on the state set up by the
@@ -925,7 +925,7 @@ update_stepper_state (GtkRange *range,
state |= GTK_STATE_FLAG_PRELIGHT;
}
- gtk_css_node_set_state (gtk_css_gadget_get_node (gadget), state);
+ gtk_css_gadget_set_state (gadget, state);
}
static void
@@ -1461,8 +1461,8 @@ gtk_range_set_show_fill_level (GtkRange *range,
priv->trough_gadget, NULL,
NULL, NULL, NULL,
NULL, NULL);
- gtk_css_node_set_state (gtk_css_gadget_get_node (priv->fill_gadget),
- gtk_css_node_get_state (gtk_css_gadget_get_node (priv->trough_gadget)));
+ gtk_css_gadget_set_state (priv->fill_gadget,
+ gtk_css_node_get_state (gtk_css_gadget_get_node (priv->trough_gadget)));
}
else
{
@@ -2070,7 +2070,7 @@ update_slider_state (GtkRange *range)
if (priv->grab_location == MOUSE_SLIDER)
state |= GTK_STATE_FLAG_ACTIVE;
- gtk_css_node_set_state (gtk_css_gadget_get_node (priv->slider_gadget), state);
+ gtk_css_gadget_set_state (priv->slider_gadget, state);
}
static void
@@ -2089,11 +2089,11 @@ update_trough_state (GtkRange *range)
if (priv->grab_location == MOUSE_TROUGH)
state |= GTK_STATE_FLAG_ACTIVE;
- gtk_css_node_set_state (gtk_css_gadget_get_node (priv->trough_gadget), state);
+ gtk_css_gadget_set_state (priv->trough_gadget, state);
if (priv->highlight_gadget)
- gtk_css_node_set_state (gtk_css_gadget_get_node (priv->highlight_gadget), state);
+ gtk_css_gadget_set_state (priv->highlight_gadget, state);
if (priv->fill_gadget)
- gtk_css_node_set_state (gtk_css_gadget_get_node (priv->fill_gadget), state);
+ gtk_css_gadget_set_state (priv->fill_gadget, state);
}
static void
@@ -4068,8 +4068,8 @@ _gtk_range_set_has_origin (GtkRange *range,
priv->trough_gadget, NULL,
NULL, NULL, NULL,
NULL, NULL);
- gtk_css_node_set_state (gtk_css_gadget_get_node (priv->highlight_gadget),
- gtk_css_node_get_state (gtk_css_gadget_get_node (priv->trough_gadget)));
+ gtk_css_gadget_set_state (priv->highlight_gadget,
+ gtk_css_node_get_state (gtk_css_gadget_get_node (priv->trough_gadget)));
}
else
{
@@ -4187,19 +4187,19 @@ sync_stepper_gadget (GtkRange *range,
}
widget = GTK_WIDGET (range);
+ widget_node = gtk_widget_get_css_node (widget);
gadget = gtk_builtin_icon_new ("button",
widget,
NULL, NULL);
gtk_builtin_icon_set_image (GTK_BUILTIN_ICON (gadget), image_type);
gtk_css_gadget_add_class (gadget, class);
+ gtk_css_gadget_set_state (gadget, gtk_css_node_get_state (widget_node));
node = gtk_css_gadget_get_node (gadget);
- widget_node = gtk_widget_get_css_node (widget);
if (before)
gtk_css_node_insert_before (widget_node, node, gtk_css_gadget_get_node (before));
else
gtk_css_node_insert_after (widget_node, node, gtk_css_gadget_get_node (after));
- gtk_css_node_set_state (node, gtk_css_node_get_state (widget_node));
*gadget_ptr = gadget;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]