mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-05 16:04:31 +00:00
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>
This commit is contained in:
parent
09628b7484
commit
67b66a4d51
1 changed files with 0 additions and 54 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue