]> Pileus Git - ~andy/gtk/commitdiff
iconview: Render focus even in non-selected items
authorAlexander Larsson <alexl@redhat.com>
Thu, 27 Sep 2012 17:24:31 +0000 (19:24 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 27 Sep 2012 17:43:50 +0000 (19:43 +0200)
This is needed for the SELECTION_NONE mode where nothing is ever
selected, but its also needed for CTRL-<key> keynav that moves the
focus without changing the selection.

https://bugzilla.gnome.org/show_bug.cgi?id=684984

gtk/gtkiconview.c

index a1df572e1e7b1dca1056b3e5604350519ae04fd7..7eb50aee685355eaa2428bf8366f1ce1f205627c 100644 (file)
@@ -3042,14 +3042,12 @@ gtk_icon_view_paint_item (GtkIconView     *icon_view,
 
   state &= ~(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_PRELIGHT);
 
+  if ((state & GTK_STATE_FLAG_FOCUSED) &&
+      item == icon_view->priv->cursor_item)
+    flags |= GTK_CELL_RENDERER_FOCUSED;
+
   if (item->selected)
     {
-      if ((state & GTK_STATE_FLAG_FOCUSED) &&
-          item == icon_view->priv->cursor_item)
-        {
-          flags |= GTK_CELL_RENDERER_FOCUSED;
-        }
-
       state |= GTK_STATE_FLAG_SELECTED;
       flags |= GTK_CELL_RENDERER_SELECTED;
     }