[gtk+] entry: Fix drag highlight problems
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] entry: Fix drag highlight problems
- Date: Fri, 11 Mar 2016 13:02:18 +0000 (UTC)
commit 2fee5fbda702a232054e95a1eade89bd7fa0f39b
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Mar 11 08:01:06 2016 -0500
entry: Fix drag highlight problems
We don't want drag highlights around icons or progress, so don't
propagate the :drop(active) state to them.
gtk/gtkentry.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index a2ec505..000322b 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -2771,7 +2771,7 @@ gtk_entry_init (GtkEntry *entry)
gtk_css_node_set_name (priv->undershoot_node[i], I_("undershoot"));
gtk_css_node_add_class (priv->undershoot_node[i], g_quark_from_static_string (i == 0 ?
GTK_STYLE_CLASS_LEFT : GTK_STYLE_CLASS_RIGHT));
gtk_css_node_set_parent (priv->undershoot_node[i], widget_node);
- gtk_css_node_set_state (priv->undershoot_node[i], gtk_css_node_get_state (widget_node));
+ gtk_css_node_set_state (priv->undershoot_node[i], gtk_css_node_get_state (widget_node) &
~GTK_STATE_FLAG_DROP_ACTIVE);
g_object_unref (priv->undershoot_node[i]);
}
}
@@ -3175,7 +3175,7 @@ update_icon_state (GtkWidget *widget,
return;
state = gtk_widget_get_state_flags (widget);
- state &= ~GTK_STATE_FLAG_PRELIGHT;
+ state &= ~(GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_DROP_ACTIVE);
if ((state & GTK_STATE_FLAG_INSENSITIVE) || icon_info->insensitive)
state |= GTK_STATE_FLAG_INSENSITIVE;
@@ -3192,11 +3192,15 @@ update_node_state (GtkEntry *entry)
GtkStateFlags state;
state = gtk_widget_get_state_flags (GTK_WIDGET (entry));
+ state &= ~GTK_STATE_FLAG_DROP_ACTIVE;
if (priv->progress_gadget)
gtk_css_gadget_set_state (priv->progress_gadget, state);
if (priv->selection_node)
gtk_css_node_set_state (priv->selection_node, state);
+
+ gtk_css_node_set_state (priv->undershoot_node[0], state);
+ gtk_css_node_set_state (priv->undershoot_node[1], state);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]