[gtk+] entry: Use the widget state flags as a base for drawing icons and text
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] entry: Use the widget state flags as a base for drawing icons and text
- Date: Mon, 19 Dec 2011 19:24:08 +0000 (UTC)
commit 754eabeb19aef2561199647e9e044fa6edeb985c
Author: Rui Matos <tiagomatos gmail com>
Date: Sat Dec 17 19:29:16 2011 +0000
entry: Use the widget state flags as a base for drawing icons and text
gtk/gtkentry.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index d0c2372..3d76e8c 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -2461,9 +2461,11 @@ gtk_entry_prepare_context_for_icon (GtkEntry *entry,
GtkStateFlags state;
widget = GTK_WIDGET (entry);
- state = GTK_STATE_FLAG_NORMAL;
+ state = gtk_widget_get_state_flags (widget);
+
+ state &= ~(GTK_STATE_FLAG_PRELIGHT);
- if (!gtk_widget_is_sensitive (widget) || icon_info->insensitive)
+ if ((state & GTK_STATE_FLAG_INSENSITIVE) || icon_info->insensitive)
state |= GTK_STATE_FLAG_INSENSITIVE;
else if (icon_info->prelight)
state |= GTK_STATE_FLAG_PRELIGHT;
@@ -5717,10 +5719,8 @@ draw_text_with_color (GtkEntry *entry,
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
gtk_entry_get_pixel_ranges (entry, &ranges, &n_ranges);
- state = GTK_STATE_FLAG_SELECTED;
-
- if (gtk_widget_has_focus (widget))
- state |= GTK_STATE_FLAG_FOCUSED;
+ state = gtk_widget_get_state_flags (widget);
+ state |= GTK_STATE_FLAG_SELECTED;
gtk_style_context_get_background_color (context, state, &selection_color);
gtk_style_context_get_color (context, state, &text_color);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]