[gtk/dnd-gestures-2: 40/57] expander: Don't highlight on dnd



commit 4b3dbc79039abaad93eb41e75dcf1f6ee44fb7dd
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jan 5 17:16:47 2020 -0500

    expander: Don't highlight on dnd
    
    We just want to let drags expand the expander,
    never actually accept a drop. So, don't highlight.

 gtk/gtkexpander.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index c6ed89cbe7..7353126e80 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -198,6 +198,8 @@ static gboolean gtk_expander_drag_motion    (GtkDropTarget    *dest,
                                              GtkExpander      *expander);
 static void     gtk_expander_drag_leave     (GtkDropTarget    *dest,
                                              GtkExpander      *expander);
+static void     gtk_expander_armed          (GtkExpander      *expander);
+
 
 static void gtk_expander_add    (GtkContainer *container,
                                  GtkWidget    *widget);
@@ -380,6 +382,8 @@ gtk_expander_init (GtkExpander *expander)
   gdk_content_formats_unref (formats);
   g_signal_connect (dest, "drag-motion", G_CALLBACK (gtk_expander_drag_motion), expander);
   g_signal_connect (dest, "drag-leave", G_CALLBACK (gtk_expander_drag_leave), expander);
+  g_signal_connect_swapped (dest, "notify::armed", G_CALLBACK (gtk_expander_armed), expander);
+
   gtk_drop_target_attach (dest, GTK_WIDGET (expander));
 
   gesture = gtk_gesture_click_new ();
@@ -577,6 +581,12 @@ gtk_expander_drag_leave (GtkDropTarget *dest,
     }
 }
 
+static void
+gtk_expander_armed (GtkExpander *expander)
+{
+  gtk_drag_unhighlight (GTK_WIDGET (expander));
+}
+
 typedef enum
 {
   FOCUS_NONE,


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