Merge lp:~uriboni/webbrowser-app/bookmark-drag-to-folder into lp:webbrowser-app

Proposed by Ugo Riboni
Status: Needs review
Proposed branch: lp:~uriboni/webbrowser-app/bookmark-drag-to-folder
Merge into: lp:webbrowser-app
Diff against target: 94 lines (+13/-16)
3 files modified
src/app/webbrowser/BookmarksFoldersViewWide.qml (+2/-3)
src/app/webbrowser/DraggableUrlDelegateWide.qml (+5/-1)
tests/autopilot/webbrowser_app/tests/test_new_tab_view.py (+6/-12)
To merge this branch: bzr merge lp:~uriboni/webbrowser-app/bookmark-drag-to-folder
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Needs Fixing
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+275846@code.launchpad.net

Commit message

Fix dragging bookmarks to folders.

Description of the change

Fix dragging bookmarks to folders.
This only works when the UITK from the staging branch is installed, as it depends on this fix: https://code.launchpad.net/~zsombi/ubuntu-ui-toolkit/listItemContentDrag/+merge/275691

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1260. By Ugo Riboni

Merge changes from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1261. By Ugo Riboni

Merge changes from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

1261. By Ugo Riboni

Merge changes from trunk

1260. By Ugo Riboni

Merge changes from trunk

1259. By Ugo Riboni

Remove hack from AP tests

1258. By Ugo Riboni

Fix references to the BookmarksModel

1257. By Ugo Riboni

Disable swipe-to-delete when draggign or hovering over the drag grip

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/BookmarksFoldersViewWide.qml'
2--- src/app/webbrowser/BookmarksFoldersViewWide.qml 2015-10-22 08:12:32 +0000
3+++ src/app/webbrowser/BookmarksFoldersViewWide.qml 2015-11-16 09:09:28 +0000
4@@ -33,7 +33,7 @@
5 function restoreLastFocusedColumn() {
6 if (internal.lastFocusedColumn &&
7 internal.lastFocusedColumn == bookmarksList &&
8- model.count > 0) {
9+ bookmarksList.model.count > 0) {
10 bookmarksList.forceActiveFocus()
11 } else {
12 folders.forceActiveFocus()
13@@ -195,8 +195,7 @@
14 bookmarksList.interactive = true
15
16 if (dragAndDrop.target && dragAndDrop.target.folderName !== folder) {
17- bookmarksFoldersViewWideItem.model.update(entry.url, entry.title,
18- dragAndDrop.target.folderName)
19+ BookmarksModel.update(entry.url, entry.title, dragAndDrop.target.folderName)
20 dragAndDrop.success = true
21 }
22 }
23
24=== modified file 'src/app/webbrowser/DraggableUrlDelegateWide.qml'
25--- src/app/webbrowser/DraggableUrlDelegateWide.qml 2015-08-11 21:26:35 +0000
26+++ src/app/webbrowser/DraggableUrlDelegateWide.qml 2015-11-16 09:09:28 +0000
27@@ -22,6 +22,7 @@
28 UrlDelegateWide {
29 id: item
30
31+ swipeEnabled: !gripArea.containsMouse && !Drag.active
32 z: Drag.active ? 1 : 0 // display on top of siblings while dragging
33 Drag.active: gripArea.drag.active
34 Drag.hotSpot.x: grip.x
35@@ -58,7 +59,9 @@
36 height: width
37 name: "view-grid-symbolic"
38
39- opacity: item.draggable && hoverArea.containsMouse ? 1.0 : 0.0
40+ opacity: item.draggable &&
41+ (hoverArea.containsMouse || gripArea.containsMouse || item.Drag.active)
42+ ? 1.0 : 0.0
43 Behavior on opacity {
44 NumberAnimation {
45 duration: UbuntuAnimation.SnapDuration
46@@ -80,6 +83,7 @@
47 item.Drag.cancel()
48 }
49 }
50+ hoverEnabled: true
51 }
52 }
53
54
55=== modified file 'tests/autopilot/webbrowser_app/tests/test_new_tab_view.py'
56--- tests/autopilot/webbrowser_app/tests/test_new_tab_view.py 2015-10-15 19:09:59 +0000
57+++ tests/autopilot/webbrowser_app/tests/test_new_tab_view.py 2015-11-16 09:09:28 +0000
58@@ -505,14 +505,11 @@
59 folder = folders[0]
60 folder_cx = folder.globalRect.x + folder.width / 2
61 folder_cy = folder.globalRect.y + folder.height / 2
62- # Work around https://launchpad.net/bugs/1499437 by dragging downwards
63- # a little bit first, then to the target folder.
64+
65 self.pointing_device.move_to_object(grip)
66- pos = self.pointing_device.position()
67+ pos = grip.globalRect
68 self.pointing_device.press()
69- self.pointing_device.move(pos[0], pos[1] + 20)
70- self.pointing_device.move(folder_cx, folder_cy)
71- self.pointing_device.release()
72+ self.pointing_device.drag(pos[0], pos[1], folder_cx, folder_cy)
73 self.assertThat(grip.globalRect, Eventually(Equals(rect)))
74
75 # Test that dragging an item to another folder removes it from this one
76@@ -520,16 +517,13 @@
77 folder = folders[2]
78 folder_cx = folder.globalRect.x + folder.width / 2
79 folder_cy = folder.globalRect.y + folder.height / 2
80- # Work around https://launchpad.net/bugs/1499437 by dragging downwards
81- # a little bit first, then to the target folder.
82+
83 self.pointing_device.move_to_object(grip)
84- pos = self.pointing_device.position()
85+ pos = grip.globalRect
86 self.pointing_device.press()
87- self.pointing_device.move(pos[0], pos[1] + 20)
88 # Move the cursor to a few pixels below the vertical center of the
89 # folder to ensure that the folder above doesn’t get targetted instead.
90- self.pointing_device.move(folder_cx, folder_cy + 5)
91- self.pointing_device.release()
92+ self.pointing_device.drag(pos[0], pos[1], folder_cx, folder_cy + 5)
93 self.assertThat(lambda: len(view.get_bookmarks_list()),
94 Eventually(NotEquals(previous_count)))
95

Subscribers

People subscribed via source and target branches

to status/vote changes: