Commit f878cecf authored by Sebastian Kügler's avatar Sebastian Kügler
Browse files

read appview's currentItem before animating

moveRight() executed after the animation means we're querying for the
item not after it's clicked, but we have an item start the animation,
and once the animation is done, currentItem is checked, and opened.

Querying listview's currentItem before the animation fixes the wrongly
opened categories.

This should put the final nail in the coffin of
BUG:332808
parent 4552d610
......@@ -115,6 +115,8 @@ Item {
PlasmaExtras.ScrollArea {
id: appViewScrollArea
property Item activatedItem: null
anchors {
top: crumbContainer.bottom
bottom: parent.bottom
......@@ -127,7 +129,7 @@ Item {
function moveRight() {
state = "";
applicationsView.currentItem.activate();
activatedItem.activate()
applicationsView.positionViewAtBeginning()
}
......@@ -220,6 +222,10 @@ Item {
Transition {
to: "OutgoingLeft"
SequentialAnimation {
// We need to cache the currentItem since the selection can move during animation,
// and we want the item that has been clicked on, not the one that is under the
// mouse once the animation is done
ScriptAction { script: appViewScrollArea.activatedItem = applicationsView.currentItem }
NumberAnimation { properties: "x,opacity"; easing.type: Easing.InQuad; duration: units.longDuration }
ScriptAction { script: appViewScrollArea.moveRight() }
}
......
......@@ -96,8 +96,7 @@ Item {
if (mouse.button == Qt.LeftButton) {
if (appView) {
appViewScrollArea.state = "OutgoingLeft";
}
else {
} else {
listItem.activate();
}
} else if (mouse.button == Qt.RightButton) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment