on xenial help sign in
Fixed review comments
commitf86eb5bc8570de3d5a542e1c3b83f99ac9c881f1 authorNick Dedekind <nicholas.dedekind@gmail.com> dateThu 25 Jul 2013, 10:33 (13 years ago) parent5ab40fb
4 files changed+11−20
Panel/IndicatorRow.qml−2 Panel/Indicators.qml+9−16 Panel/MenuContent.qml+1−1 Panel/Panel.qml+1−1
Panel/IndicatorRow.qml−2
@@ -26,8 +26,6 @@ Item {
2626 property alias row: row
2727 property QtObject indicatorsModel: null
2828
29− Behavior on y { StandardAnimation {} }
30−
3129 width: units.gu(40)
3230 height: units.gu(3)
3331
Panel/Indicators.qml+9−16
@@ -33,6 +33,7 @@ Showable {
3333 readonly property int lockThreshold: openedHeight / 2
3434 property bool fullyOpened: height == openedHeight
3535 property bool partiallyOpened: height > panelHeight && !fullyOpened
36+ property real visualBottom: Math.max(y+height, y+indicatorRow.y+indicatorRow.height)
3637
3738 // TODO: Perhaps we need a animation standard for showing/hiding? Each showable seems to
3839 // use its own values. Need to ask design about this.
@@ -100,8 +101,8 @@ Showable {
100101 /*
101102 Vertical velocity check. Don't change the indicator if we're moving too quickly.
102103 */
103− var verticalVelocity = Math.abs(yVelocityCalculator.calculate());
104− if (verticalVelocity >= 0.05 && indicatorRow.currentItem!=null) {
104+ var verticalSpeed = Math.abs(yVelocityCalculator.calculate());
105+ if (verticalSpeed >= 0.05 && indicatorRow.currentItem!=null) {
105106 return;
106107 }
107108
@@ -282,16 +283,15 @@ Showable {
282283 }
283284 }
284285
285− property var dragHandle: null
286+ property var activeDragHandle: showDragHandle.dragging ? showDragHandle : hideDragHandle.dragging ? hideDragHandle : null
286287 // connections to the active drag handle
287288 Connections {
288− target: dragHandle
289+ target: activeDragHandle
289290 onTouchXChanged: {
290− var buffer = dragHandle.dragging ? true : false;
291− indicators.calculateCurrentItem(dragHandle.touchX, buffer);
291+ indicators.calculateCurrentItem(activeDragHandle.touchX, true);
292292 }
293293 onTouchSceneYChanged: {
294− yVelocityCalculator.trackedPosition = dragHandle.touchSceneY;
294+ yVelocityCalculator.trackedPosition = activeDragHandle.touchSceneY;
295295 }
296296 }
297297
@@ -316,9 +316,6 @@ Showable {
316316 menuContent.activateContent();
317317 }
318318 }
319− onDraggingChanged: {
320− dragHandle = dragging ? showDragHandle : null;
321− }
322319 }
323320 DragHandle {
324321 id: hideDragHandle
@@ -330,10 +327,6 @@ Showable {
330327 stretch: true
331328 maxTotalDragDistance: openedHeight - panelHeight
332329 distanceThreshold: 0
333−
334− onDraggingChanged: {
335− dragHandle = dragging ? hideDragHandle : null;
336− }
337330 }
338331
339332 AxisVelocityCalculator {
@@ -352,8 +345,8 @@ Showable {
352345 }
353346 StateChangeScript {
354347 script: {
355− if (dragHandle) {
356− calculateCurrentItem(dragHandle.touchX, false);
348+ if (activeDragHandle) {
349+ calculateCurrentItem(activeDragHandle.touchX, false);
357350 }
358351 }
359352 }
Panel/MenuContent.qml+1−1
@@ -146,7 +146,7 @@ Rectangle {
146146 Indicators.MenuContentActivator {
147147 id: menuActivator
148148 running: content.__contentActive
149− baseIndex: content.currentIndex
149+ baseIndex: content.currentMenuIndex
150150 count: indicatorsModel.count
151151 }
152152}
Panel/Panel.qml+1−1
@@ -90,10 +90,10 @@ Item {
9090 id: indicatorsSeparatorLine
9191 visible: true
9292 anchors {
93− top: indicatorsMenu.bottom
9493 left: indicatorsMenu.left
9594 right: indicatorsMenu.right
9695 }
96+ y: indicatorsMenu.visualBottom
9797 }
9898
9999 BorderImage {