From 1ba30278f554c3003170b46405031ef27f2d443a Mon Sep 17 00:00:00 2001 From: Harald Judt <h.judt@gmx.at> Date: Fri, 15 May 2015 17:02:12 +0200 Subject: [PATCH] Use "Name" column for drag & drop instead of first column (bug #11905) Instead of simply using the first column for drag & drop and the other columns for starting the rubberband selection it is better to use the column showing the filenames for this, as the user can change its position. --- thunar/thunar-details-view.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/thunar/thunar-details-view.c b/thunar/thunar-details-view.c index a093434d1..ba418aac3 100644 --- a/thunar/thunar-details-view.c +++ b/thunar/thunar-details-view.c @@ -662,7 +662,7 @@ thunar_details_view_button_press_event (GtkTreeView *tree_view, GtkTreePath *path = NULL; GtkTreeIter iter; GtkTreeViewColumn *column; - GtkTreeViewColumn *first_column; + GtkTreeViewColumn *name_column; ThunarFile *file; GtkAction *action; ThunarPreferences *preferences; @@ -676,8 +676,8 @@ thunar_details_view_button_press_event (GtkTreeView *tree_view, /* get the current selection */ selection = gtk_tree_view_get_selection (tree_view); - /* get the first column of the tree view */ - first_column = gtk_tree_view_get_column (tree_view, 0); + /* get the column showing the filenames */ + name_column = details_view->columns[THUNAR_COLUMN_NAME]; /* unselect all selected items if the user clicks on an empty area * of the treeview and no modifier key is active */ @@ -698,12 +698,12 @@ thunar_details_view_button_press_event (GtkTreeView *tree_view, { gtk_tree_path_free (cursor_path); - if (column != first_column) + if (column != name_column) gtk_tree_selection_unselect_all (selection); - /* do not start rubber banding from the first column */ + /* do not start rubber banding from the name column */ if (!gtk_tree_selection_path_is_selected (selection, path) - && column == first_column) + && column == name_column) { /* the clicked row does not have the focus and is not * selected, so make it the new selection (start) */ @@ -729,7 +729,7 @@ thunar_details_view_button_press_event (GtkTreeView *tree_view, } else { - if (column != first_column) + if (column != name_column) { /* if the clicked path is not selected, unselect all other paths */ if (!gtk_tree_selection_path_is_selected (selection, path)) -- GitLab