From c155fb565275ec96d554245d7aee3039727f941d Mon Sep 17 00:00:00 2001 From: Kevin Whitaker Date: Wed, 26 Sep 2018 11:30:57 -0400 Subject: [PATCH] Add screen to add items. Add in navigation code between stack screens. --- qml/additem.qml | 33 +++++++++++++++++++++++++++++++++ qml/main.qml | 6 ++++++ qml/otplist.qml | 3 +++ 3 files changed, 42 insertions(+) create mode 100644 qml/additem.qml diff --git a/qml/additem.qml b/qml/additem.qml new file mode 100644 index 0000000..154a703 --- /dev/null +++ b/qml/additem.qml @@ -0,0 +1,33 @@ +import QtQuick 2.10 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.2 + +Item { + ToolBar { + id:tools + anchors.right: parent.right + anchors.left: parent.left + RowLayout { + id:toolrow + anchors.fill: parent + ToolButton { + id:back + text: "⬅" + Layout.alignment: Qt.AlignLeft + onClicked: tools.parent.parent.goBack() + } + } + } + ColumnLayout { + id: col + spacing: 2 + anchors.top: tools.bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + RowLayout { + id:settingsDefaultTimeGroup + Layout.fillWidth: true + } + } +} \ No newline at end of file diff --git a/qml/main.qml b/qml/main.qml index 6378f4c..b65d492 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -12,5 +12,11 @@ ApplicationWindow { id: stack initialItem: "otplist.qml" anchors.fill: parent + signal changeFrame(string item) + signal goBack() + Connections { + onChangeFrame: stack.push(Qt.resolvedUrl(item)) + onGoBack: stack.pop() + } } } \ No newline at end of file diff --git a/qml/otplist.qml b/qml/otplist.qml index dbd2b23..b0495a1 100644 --- a/qml/otplist.qml +++ b/qml/otplist.qml @@ -18,6 +18,9 @@ Item { ToolTip.text: qsTr("Add Item") ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval ToolTip.visible: down + onClicked: { + otpTimeout.parent.parent.changeFrame("additem.qml") + } } ToolButton { id: addQRItem -- GitLab