[gtk/dnd-gestures-2: 134/175] iconview: Render drop highlight properly



commit f258d7ea3352b285a9c93b30b57478b2c434a06d
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 6 21:25:15 2020 -0500

    iconview: Render drop highlight properly
    
    Use :drop(active) and render a frame, not focus.

 gtk/gtkiconview.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 21ba41a2e1..85f90a2991 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1754,9 +1754,15 @@ gtk_icon_view_snapshot (GtkWidget   *widget,
          break;
         }
 
-      gtk_snapshot_render_focus (snapshot, context,
+     
+      gtk_style_context_save (context);
+      gtk_style_context_set_state (context, gtk_style_context_get_state (context) | 
GTK_STATE_FLAG_DROP_ACTIVE);
+
+      gtk_snapshot_render_frame (snapshot, context,
                                  rect.x, rect.y,
                                  rect.width, rect.height);
+
+      gtk_style_context_restore (context);
     }
 
   if (icon_view->priv->doing_rubberband)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]