[gtk+] spinbutton: update node state more often
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] spinbutton: update node state more often
- Date: Sun, 15 Nov 2015 04:18:58 +0000 (UTC)
commit a24de82cedd0ef0f7d0c4136b2f952a3b2d6d4e8
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Nov 14 23:18:17 2015 -0500
spinbutton: update node state more often
We need to update the entry_node state, and we should
update the node state initially.
gtk/gtkspinbutton.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 4826f5d..2a32e13 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -308,6 +308,7 @@ static void gtk_spin_button_real_change_value (GtkSpinButton *spin,
static gint gtk_spin_button_default_input (GtkSpinButton *spin_button,
gdouble *new_val);
static void gtk_spin_button_default_output (GtkSpinButton *spin_button);
+static void update_node_state (GtkSpinButton *spin_button);
static guint spinbutton_signals[LAST_SIGNAL] = {0};
@@ -824,10 +825,11 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
g_signal_connect_object (priv->up_node, "style-changed", G_CALLBACK (node_style_changed_cb), spin_button,
0);
g_object_unref (priv->up_node);
- update_node_ordering (spin_button);
-
gtk_spin_button_set_adjustment (spin_button, NULL);
+ update_node_ordering (spin_button);
+ update_node_state (spin_button);
+
gtk_widget_add_events (GTK_WIDGET (spin_button), GDK_SCROLL_MASK);
priv->swipe_gesture = gtk_gesture_swipe_new (GTK_WIDGET (spin_button));
@@ -1488,6 +1490,7 @@ gtk_spin_button_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state)
{
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
+ GtkSpinButtonPrivate *priv = spin->priv;
if (!gtk_widget_is_sensitive (widget))
{
@@ -1495,6 +1498,7 @@ gtk_spin_button_state_flags_changed (GtkWidget *widget,
gtk_widget_queue_draw (GTK_WIDGET (spin));
}
+ gtk_css_node_set_state (priv->entry_node, gtk_widget_get_state_flags (widget));
update_node_state (spin);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]