Merge lp:~jeremywootten/pantheon-files/fix-1623283-drop-into-wrong-folder into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Cody Garver
Approved revision: 2318
Merged at revision: 2343
Proposed branch: lp:~jeremywootten/pantheon-files/fix-1623283-drop-into-wrong-folder
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 40 lines (+7/-5)
2 files modified
src/View/AbstractDirectoryView.vala (+3/-3)
src/View/IconView.vala (+4/-2)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/fix-1623283-drop-into-wrong-folder
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+305962@code.launchpad.net

Commit message

Correct drag coords for scrolling in IconView (lp:1623283)

Description of the change

This branch corrects IconView.get_path_pos () which, unlike AbstractTreeView.get_path_pos () needs to convert the drag coordinates to bin window coordinates.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/View/AbstractDirectoryView.vala'
2--- src/View/AbstractDirectoryView.vala 2016-09-15 11:52:44 +0000
3+++ src/View/AbstractDirectoryView.vala 2016-09-16 14:11:40 +0000
4@@ -1655,8 +1655,8 @@
5
6 /** DnD helpers */
7
8- private GOF.File? get_drop_target_file (int x, int y, out Gtk.TreePath? path_return) {
9- Gtk.TreePath? path = get_path_at_pos (x, y);
10+ private GOF.File? get_drop_target_file (int win_x, int win_y, out Gtk.TreePath? path_return) {
11+ Gtk.TreePath? path = get_path_at_pos (win_x, win_y);
12 GOF.File? file = null;
13
14 if (path != null) {
15@@ -3488,7 +3488,7 @@
16
17 /** Abstract methods - must be overridden*/
18 public abstract GLib.List<Gtk.TreePath> get_selected_paths () ;
19- public abstract Gtk.TreePath? get_path_at_pos (int x, int y);
20+ public abstract Gtk.TreePath? get_path_at_pos (int x, int win);
21 public abstract Gtk.TreePath? get_path_at_cursor ();
22 public abstract void select_all ();
23 public abstract void unselect_all ();
24
25=== modified file 'src/View/IconView.vala'
26--- src/View/IconView.vala 2016-06-27 12:08:16 +0000
27+++ src/View/IconView.vala 2016-09-16 14:11:40 +0000
28@@ -121,8 +121,10 @@
29 tree.set_drag_dest_item (path, Gtk.IconViewDropPosition.DROP_INTO);
30 }
31
32- public override Gtk.TreePath? get_path_at_pos (int x, int y) {
33- return tree.get_path_at_pos (x, y);
34+ public override Gtk.TreePath? get_path_at_pos (int win_x, int win_y) {
35+ /* Supplied coords are drag coords - need IconView bin window coords */
36+ /* Icon view does not scroll horizontally so no adjustment needed for x coord*/
37+ return tree.get_path_at_pos (win_x, win_y + (int)(get_vadjustment ().get_value ()));
38 }
39
40 public override void select_all () {

Subscribers

People subscribed via source and target branches

to all changes: