[gtk+/wip/cssnode3: 98/102] entry: Set the prelight flag on the CSS node
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssnode3: 98/102] entry: Set the prelight flag on the CSS node
- Date: Wed, 11 Mar 2015 00:24:39 +0000 (UTC)
commit 036f78f56432fef4335ee365f59d5622d0154111
Author: Benjamin Otte <otte redhat com>
Date: Tue Mar 10 17:32:01 2015 +0100
entry: Set the prelight flag on the CSS node
gtk/gtkentry.c | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 55af63e..d7f1690 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -2804,18 +2804,12 @@ gtk_entry_prepare_context_for_icon (GtkEntry *entry,
{
GtkEntryPrivate *priv = entry->priv;
EntryIconInfo *icon_info = priv->icons[icon_pos];
- GtkWidget *widget;
GtkStateFlags state;
- widget = GTK_WIDGET (entry);
- state = gtk_widget_get_state_flags (widget);
-
- state &= ~(GTK_STATE_FLAG_PRELIGHT);
+ state = gtk_css_node_get_state (icon_info->css_node);
if ((state & GTK_STATE_FLAG_INSENSITIVE) || icon_info->insensitive)
state |= GTK_STATE_FLAG_INSENSITIVE;
- else if (icon_info->prelight)
- state |= GTK_STATE_FLAG_PRELIGHT;
gtk_css_node_set_state (icon_info->css_node, state);
@@ -4097,10 +4091,7 @@ gtk_entry_enter_notify (GtkWidget *widget,
if (icon_info != NULL && event->window == icon_info->window)
{
if (should_prelight (entry, i))
- {
- icon_info->prelight = TRUE;
- gtk_widget_queue_draw (widget);
- }
+ gtk_css_node_add_state (icon_info->css_node, GTK_STATE_FLAG_PRELIGHT);
break;
}
@@ -4128,10 +4119,7 @@ gtk_entry_leave_notify (GtkWidget *widget,
icon_info->pressed = FALSE;
if (should_prelight (entry, i))
- {
- icon_info->prelight = FALSE;
- gtk_widget_queue_draw (widget);
- }
+ gtk_css_node_remove_state (icon_info->css_node, GTK_STATE_FLAG_PRELIGHT);
break;
}
@@ -9034,7 +9022,7 @@ gtk_entry_set_icon_sensitive (GtkEntry *entry,
icon_info->insensitive = !sensitive;
icon_info->pressed = FALSE;
- icon_info->prelight = FALSE;
+ gtk_css_node_remove_state (icon_info->css_node, GTK_STATE_FLAG_PRELIGHT);
if (gtk_widget_get_realized (GTK_WIDGET (entry)))
update_cursors (GTK_WIDGET (entry));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]