summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/mobilecomponents/PageRow.qml
diff options
context:
space:
mode:
authorGravatar Sebastian Kügler <sebas@kde.org>2015-12-04 00:27:35 +0100
committerGravatar Sebastian Kügler <sebas@kde.org>2015-12-07 18:46:32 +0100
commitb6f5f235f0ab3c84e960f2cf46e542592195abbf (patch)
tree9bee0cc96f0eafb2febda9974d39279008155603 /qt-mobile/qml/mobilecomponents/PageRow.qml
parent72411eee63fba5cfba5a97e438e5c494fa928fd0 (diff)
downloadsubsurface-b6f5f235f0ab3c84e960f2cf46e542592195abbf.tar.gz
sync with mobilecomponents 9d8bf6d77d
- Fixes interactivity in context drawer. - These are mostly cleanups that have been done pre-merge of these components. This now is the state of master in plasma-mobile. - makes navigation a bit more intuitive Signed-off-by: Sebastian Kügler <sebas@kde.org>
Diffstat (limited to 'qt-mobile/qml/mobilecomponents/PageRow.qml')
-rw-r--r--qt-mobile/qml/mobilecomponents/PageRow.qml19
1 files changed, 13 insertions, 6 deletions
diff --git a/qt-mobile/qml/mobilecomponents/PageRow.qml b/qt-mobile/qml/mobilecomponents/PageRow.qml
index 4d6adf5a7..ab0e9a5ed 100644
--- a/qt-mobile/qml/mobilecomponents/PageRow.qml
+++ b/qt-mobile/qml/mobilecomponents/PageRow.qml
@@ -82,6 +82,7 @@ Item {
// Returns the page instance.
function push(page, properties, immediate)
{
+ pop(lastVisiblePage, true);
scrollAnimation.running = false;
var item = Engine.push(page, properties, false, immediate)
scrollToLevel(depth)
@@ -102,6 +103,7 @@ Item {
// See push() for details.
function replace(page, properties, immediate)
{
+ pop(lastVisiblePage, true);
scrollAnimation.running = false;
var item = Engine.push(page, properties, true, immediate);
scrollToLevel(depth)
@@ -147,6 +149,11 @@ Item {
}
ScriptAction {
script: {
+ //At startup sometimes the contentX is NaN for an instant
+ if (isNaN(mainFlickable.contentX)) {
+ return;
+ }
+
actualRoot.lastVisiblePage = root.children[Math.floor((mainFlickable.contentX + mainFlickable.width - 1)/columnWidth)].page
}
}
@@ -211,8 +218,8 @@ Item {
contentHeight: height
Row {
id: root
- spacing: -100
- width: Math.max((depth-1+children[children.length-1].takenColumns) * columnWidth, childrenRect.width - 100)
+ spacing: -Units.gridUnit * 8
+ width: Math.max((depth-1+children[children.length-1].takenColumns) * columnWidth, childrenRect.width - Units.gridUnit * 8)
height: parent.height
Behavior on width {
@@ -238,7 +245,7 @@ Item {
Item {
id: container
- implicitWidth: actualContainer.width + 100
+ implicitWidth: actualContainer.width + Units.gridUnit * 8
width: implicitWidth
height: parent ? parent.height : 0
@@ -293,7 +300,7 @@ Item {
top: parent.top
bottom: parent.bottom
right: parent.right
- rightMargin: 100
+ rightMargin: Units.gridUnit * 8
}
property int takenColumns: {
@@ -413,13 +420,13 @@ Item {
State {
name: "Left"
PropertyChanges { target: container; opacity: 0 }
- PropertyChanges { target: container; width: 100}
+ PropertyChanges { target: container; width: Units.gridUnit * 8}
},
// Start state for push entry, end state for pop exit.
State {
name: "Right"
PropertyChanges { target: container; opacity: 0 }
- PropertyChanges { target: container; width: 100}
+ PropertyChanges { target: container; width: Units.gridUnit * 8}
},
// Inactive state.
State {