[gtk+] iconview: Use the widget state flags as a base for drawing items
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] iconview: Use the widget state flags as a base for drawing items
- Date: Mon, 19 Dec 2011 19:24:33 +0000 (UTC)
commit f4b9562f46fa587ad60d6188e20f4afc4d672a28
Author: Rui Matos <tiagomatos gmail com>
Date: Mon Dec 19 14:04:10 2011 +0000
iconview: Use the widget state flags as a base for drawing items
gtk/gtkiconview.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index df5004e..79f94db 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -2822,17 +2822,19 @@ gtk_icon_view_paint_item (GtkIconView *icon_view,
_gtk_icon_view_set_cell_data (icon_view, item);
style_context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
gtk_style_context_save (style_context);
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_VIEW);
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_CELL);
+ state &= ~(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_PRELIGHT);
+
if (item->selected)
{
- if (gtk_widget_has_focus (widget) &&
+ if ((state & GTK_STATE_FLAG_FOCUSED) &&
item == icon_view->priv->cursor_item)
{
- state |= GTK_STATE_FLAG_FOCUSED;
flags |= GTK_CELL_RENDERER_FOCUSED;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]