summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-tree-view-drag-dest.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-11-16 05:08:48 -0800
committerStefano Karapetsas <[email protected]>2012-11-16 05:08:48 -0800
commitdc66bc40724191f0068869773576dc4edf042c6f (patch)
tree74b9684feea188736b21f2c829f29befaaf2e9da /libcaja-private/caja-tree-view-drag-dest.c
parent935e1fed604f48e68d125d205c890a59f46f8f21 (diff)
parent1466df20591105550738a1d0784a623af9909abf (diff)
downloadcaja-dc66bc40724191f0068869773576dc4edf042c6f.tar.bz2
caja-dc66bc40724191f0068869773576dc4edf042c6f.tar.xz
Merge pull request #42 from jasmineaura/develop
Bring Caja up to speed, stage1
Diffstat (limited to 'libcaja-private/caja-tree-view-drag-dest.c')
-rw-r--r--libcaja-private/caja-tree-view-drag-dest.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/libcaja-private/caja-tree-view-drag-dest.c b/libcaja-private/caja-tree-view-drag-dest.c
index 1c25c452..56e9a1cd 100644
--- a/libcaja-private/caja-tree-view-drag-dest.c
+++ b/libcaja-private/caja-tree-view-drag-dest.c
@@ -110,9 +110,9 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
window = gtk_tree_view_get_bin_window (tree_view);
#if GTK_CHECK_VERSION(3, 0, 0)
- vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(tree_view));
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(tree_view));
#else
- vadjustment = gtk_tree_view_get_vadjustment(tree_view);
+ vadjustment = gtk_tree_view_get_vadjustment (tree_view);
#endif
gdk_window_get_pointer (window, NULL, &y, NULL);
@@ -186,35 +186,42 @@ remove_expand_timeout (CajaTreeViewDragDest *dest)
}
static gboolean
+#if GTK_CHECK_VERSION(3,0,0)
+highlight_draw (GtkWidget *widget,
+ cairo_t *cr,
+ gpointer data)
+#else
highlight_expose (GtkWidget *widget,
GdkEventExpose *event,
gpointer data)
+#endif
{
GdkWindow *bin_window;
int width;
int height;
- if (gtk_widget_is_drawable (widget))
- {
- bin_window =
- gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget));
+ /* FIXMEchpe: is bin window right here??? */
+ bin_window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget));
#if GTK_CHECK_VERSION(3, 0, 0)
- width = gdk_window_get_width(GDK_WINDOW(bin_window));
- height = gdk_window_get_height(GDK_WINDOW(bin_window));
+ width = gdk_window_get_width(bin_window);
+ height = gdk_window_get_height(bin_window);
#else
- gdk_drawable_get_size(bin_window, &width, &height);
+ gdk_drawable_get_size(bin_window, &width, &height);
#endif
-
- gtk_paint_focus (gtk_widget_get_style (widget),
- bin_window,
- gtk_widget_get_state (widget),
- NULL,
- widget,
- "treeview-drop-indicator",
- 0, 0, width, height);
- }
+ gtk_paint_focus (gtk_widget_get_style (widget),
+#if GTK_CHECK_VERSION(3,0,0)
+ cr,
+ gtk_widget_get_state (widget),
+#else
+ bin_window,
+ gtk_widget_get_state (widget),
+ NULL,
+#endif
+ widget,
+ "treeview-drop-indicator",
+ 0, 0, width, height);
return FALSE;
}
@@ -234,8 +241,13 @@ set_widget_highlight (CajaTreeViewDragDest *dest, gboolean highlight)
{
dest->details->highlight_id =
g_signal_connect_object (dest->details->tree_view,
+#if GTK_CHECK_VERSION(3,0,0)
+ "draw",
+ G_CALLBACK (highlight_draw),
+#else
"expose_event",
G_CALLBACK (highlight_expose),
+#endif
dest, 0);
gtk_widget_queue_draw (GTK_WIDGET (dest->details->tree_view));
}