diff options
author | Javier S. Pedro <dev.git@javispedro.com> | 2014-09-13 22:40:39 +0200 |
---|---|---|
committer | Javier S. Pedro <dev.git@javispedro.com> | 2014-09-13 22:40:39 +0200 |
commit | 85fb48bc51fed06a50b6178727fdf9e96aea4fc4 (patch) | |
tree | e5aa942addaf99bb29c73f5e946cf250ca8b80f8 /qml/pages/WatchView.qml | |
parent | ed40a7f1cbc1da5ae21c58882df241fc0071c2f7 (diff) | |
download | salmeta-85fb48bc51fed06a50b6178727fdf9e96aea4fc4.tar.gz salmeta-85fb48bc51fed06a50b6178727fdf9e96aea4fc4.zip |
UI can now add some widgets around
Diffstat (limited to 'qml/pages/WatchView.qml')
-rw-r--r-- | qml/pages/WatchView.qml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/qml/pages/WatchView.qml b/qml/pages/WatchView.qml new file mode 100644 index 0000000..e738f4e --- /dev/null +++ b/qml/pages/WatchView.qml @@ -0,0 +1,45 @@ +import QtQuick 2.0 +import "../watch" + +Flickable { + id: watchView + width: 96 + height: 96 + clip: true + flickableDirection: Flickable.HorizontalFlick + + property int curPage: 0 + + WidgetView { + id: widgetView + model: curWidgets + editMode: true + onEmptyWidgetClicked: { + pageStack.push(Qt.resolvedUrl("AddWidget.qml"), { + 'addToPage': page, + 'addToPos': pos + }); + } + } + + contentWidth: widgetView.width + contentHeight: widgetView.height + + NumberAnimation { + id: pivotAnim + targets: watchView + property: "contentX" + to: curPage * watchView.width + duration: 100 + easing.type: Easing.InOutQuad + } + + onMovementStarted: { + pivotAnim.stop() + } + + onMovementEnded: { + curPage = Math.round(watchView.contentX / watchView.width) + pivotAnim.start() + } +} |