on xenial help sign in
Make the dragged distance be a multiple of the dragged area
abff148Albert Astals
qml/Dash/DashContent.qml−4
@@ -118,10 +118,6 @@ Item {
118 cacheBuffer: 1073741823
118 cacheBuffer: 1073741823
119 onMovementStarted: currentItem.item.showHeader();
119 onMovementStarted: currentItem.item.showHeader();
120 clip: parent.x != 0
120 clip: parent.x != 0
121− onDraggingChanged: console.log("dragging", dragging);
122− onMovingChanged: console.log("moving", moving);
123− onContentXChanged: console.log("contentX", contentX);
124− onCurrentIndexChanged: console.log("currentIndex", currentIndex);
125
121
126 // TODO QTBUG-40846 and QTBUG-40848
122 // TODO QTBUG-40846 and QTBUG-40848
127 // The remove transition doesn't happen when removing the last item
123 // The remove transition doesn't happen when removing the last item
tests/autopilot/unity8/shell/emulators/dash.py+12−6
@@ -129,10 +129,13 @@ class Dash(emulators.UnityEmulatorBase):
129 original_index = self.dash_content_list.currentIndex
129 original_index = self.dash_content_list.currentIndex
130 dash_content = self.select_single(objectName="dashContent")
130 dash_content = self.select_single(objectName="dashContent")
131 x, y, width, height = dash_content.globalRect
131 x, y, width, height = dash_content.globalRect
132+ rate = 10
133+ divisions = 5
134+ jump = ( width / divisions ) // rate * rate
132− start_x = x + width / 5
135+ start_x = x + jump
133− stop_x = x + width / 5 * 4
136+ stop_x = x + jump * (divisions - 1)
134 start_y = stop_y = y + 1
137 start_y = stop_y = y + 1
135− self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
138+ self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate)
136 self.dash_content_list.currentIndex.wait_for(original_index - 1)
139 self.dash_content_list.currentIndex.wait_for(original_index - 1)
137
140
138 @autopilot_logging.log_action(logger.info)
141 @autopilot_logging.log_action(logger.info)
@@ -140,10 +143,13 @@ class Dash(emulators.UnityEmulatorBase):
140 original_index = self.dash_content_list.currentIndex
143 original_index = self.dash_content_list.currentIndex
141 dash_content = self.select_single(objectName="dashContent")
144 dash_content = self.select_single(objectName="dashContent")
142 x, y, width, height = dash_content.globalRect
145 x, y, width, height = dash_content.globalRect
146+ rate = 10
147+ divisions = 5
148+ jump = ( width / divisions ) // rate * rate
143− start_x = x + width / 5 * 4
149+ start_x = x + jump * (divisions - 1)
144− stop_x = x + width / 5
150+ stop_x = x + jump
145 start_y = stop_y = y + 1
151 start_y = stop_y = y + 1
146− self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
152+ self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate)
147 self.dash_content_list.currentIndex.wait_for(original_index + 1)
153 self.dash_content_list.currentIndex.wait_for(original_index + 1)
148
154
149 def enter_search_query(self, query):
155 def enter_search_query(self, query):