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



commit b404836e6f1240878a71bf398febf3a9ca59513b
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 81572a2fa9..5a7c0f6dca 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1757,9 +1757,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]