[nautilus/wip/antoniof/gtk4-preparation-drop-outgoing-api: 22/23] tree-view-drag-dest: Stop connecting to ::draw




commit c31aa7ce69822e05ce519e04d71fd30826a25e23
Author: Ernestas Kulik <ernestask gnome org>
Date:   Wed Jul 11 14:43:51 2018 +0300

    tree-view-drag-dest: Stop connecting to ::draw
    
    The "treeview-drop-indicator" style class was a thing in GTK2, but not
    in GTK3. So, remove this old code which isn't even do anything visible
    anymore. Also, the ::draw signal is going away when we move to GTK4.
    
    Rebased and ammended by António Fernandes <antoniof gnome org>

 src/nautilus-tree-view-drag-dest.c | 54 --------------------------------------
 1 file changed, 54 deletions(-)
---
diff --git a/src/nautilus-tree-view-drag-dest.c b/src/nautilus-tree-view-drag-dest.c
index 3acac2434..9381974d8 100644
--- a/src/nautilus-tree-view-drag-dest.c
+++ b/src/nautilus-tree-view-drag-dest.c
@@ -182,64 +182,12 @@ remove_expand_timer (NautilusTreeViewDragDest *dest)
     }
 }
 
-static gboolean
-highlight_draw (GtkWidget *widget,
-                cairo_t   *cr,
-                gpointer   data)
-{
-    GdkWindow *bin_window;
-    int width;
-    int height;
-    GtkStyleContext *style;
-
-    /* FIXMEchpe: is bin window right here??? */
-    bin_window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget));
-
-    width = gdk_window_get_width (bin_window);
-    height = gdk_window_get_height (bin_window);
-
-    style = gtk_widget_get_style_context (widget);
-
-    gtk_style_context_save (style);
-    gtk_style_context_add_class (style, "treeview-drop-indicator");
-
-    gtk_render_focus (style,
-                      cr,
-                      0, 0, width, height);
-
-    gtk_style_context_restore (style);
-
-    return FALSE;
-}
-
-static void
-set_widget_highlight (NautilusTreeViewDragDest *dest,
-                      gboolean                  highlight)
-{
-    if (!highlight)
-    {
-        g_clear_signal_handler (&dest->details->highlight_id, dest->details->tree_view);
-        gtk_widget_queue_draw (GTK_WIDGET (dest->details->tree_view));
-    }
-
-    if (highlight && !dest->details->highlight_id)
-    {
-        dest->details->highlight_id =
-            g_signal_connect_object (dest->details->tree_view,
-                                     "draw",
-                                     G_CALLBACK (highlight_draw),
-                                     dest, 0);
-        gtk_widget_queue_draw (GTK_WIDGET (dest->details->tree_view));
-    }
-}
-
 static void
 set_drag_dest_row (NautilusTreeViewDragDest *dest,
                    GtkTreePath              *path)
 {
     if (path)
     {
-        set_widget_highlight (dest, FALSE);
         gtk_tree_view_set_drag_dest_row
             (dest->details->tree_view,
             path,
@@ -247,7 +195,6 @@ set_drag_dest_row (NautilusTreeViewDragDest *dest,
     }
     else
     {
-        set_widget_highlight (dest, TRUE);
         gtk_tree_view_set_drag_dest_row (dest->details->tree_view,
                                          NULL,
                                          0);
@@ -258,7 +205,6 @@ static void
 clear_drag_dest_row (NautilusTreeViewDragDest *dest)
 {
     gtk_tree_view_set_drag_dest_row (dest->details->tree_view, NULL, 0);
-    set_widget_highlight (dest, FALSE);
 }
 
 static gboolean


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