flickable for wizardController

This commit is contained in:
dsc 2019-04-08 03:43:18 +02:00
parent d2c47606ca
commit bd2687c22f
No known key found for this signature in database
GPG key ID: 7BBC83D7A8810AAB
2 changed files with 85 additions and 41 deletions

View file

@ -26,13 +26,15 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQml 2.0
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.1
import QtQuick.Layouts 1.2
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtGraphicalEffects 1.0
import moneroComponents.Wallet 1.0 import moneroComponents.Wallet 1.0
import "../js/Wizard.js" as Wizard import "../js/Wizard.js" as Wizard
import "../js/Windows.js" as Windows import "../js/Windows.js" as Windows
import "../js/Utils.js" as Utils import "../js/Utils.js" as Utils
@ -104,6 +106,9 @@ Rectangle {
// recovery made (restore wallet) // recovery made (restore wallet)
property string walletRestoreMode: 'seed' // seed, keys, qr property string walletRestoreMode: 'seed' // seed, keys, qr
// flickable margin
property int flickableHeightMargin
property int layoutScale: { property int layoutScale: {
if(isMobile){ if(isMobile){
return 0; return 0;
@ -182,56 +187,89 @@ Rectangle {
State { State {
name: "wizardLanguage" name: "wizardLanguage"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardLanguageView } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardLanguageView }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardLanguageView.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardHome" name: "wizardHome"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardHomeView } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardHomeView }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardHomeView.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardCreateWallet1" name: "wizardCreateWallet1"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateWallet1View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateWallet1View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardCreateWallet1View.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardCreateWallet2" name: "wizardCreateWallet2"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateWallet2View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateWallet2View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardCreateWallet2View.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardCreateWallet3" name: "wizardCreateWallet3"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateWallet3View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateWallet3View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardCreateWallet3View.height + wizardController.flickableHeightMargin + 400 }
}, State { }, State {
name: "wizardCreateWallet4" name: "wizardCreateWallet4"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateWallet4View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateWallet4View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardCreateWallet4View.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardRestoreWallet1" name: "wizardRestoreWallet1"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardRestoreWallet1View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardRestoreWallet1View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardRestoreWallet1View.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardRestoreWallet2" name: "wizardRestoreWallet2"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardRestoreWallet2View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardRestoreWallet2View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardRestoreWallet2View.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardRestoreWallet3" name: "wizardRestoreWallet3"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardRestoreWallet3View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardRestoreWallet3View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardRestoreWallet3View.childrenRect.height + wizardController.flickableHeightMargin + 400 }
}, State { }, State {
name: "wizardRestoreWallet4" name: "wizardRestoreWallet4"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardRestoreWallet4View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardRestoreWallet4View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardRestoreWallet4View.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardCreateDevice1" name: "wizardCreateDevice1"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateDevice1View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardCreateDevice1View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardCreateDevice1View.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardOpenWallet1" name: "wizardOpenWallet1"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardOpenWallet1View } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardOpenWallet1View }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardOpenWallet1View.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardModeSelection" name: "wizardModeSelection"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardModeSelectionView } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardModeSelectionView }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardModeSelectionView.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardModeRemoteNodeWarning" name: "wizardModeRemoteNodeWarning"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardModeRemoteNodeWarningView } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardModeRemoteNodeWarningView }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardModeRemoteNodeWarningView.childrenRect.height + wizardController.flickableHeightMargin }
}, State { }, State {
name: "wizardModeBootstrap" name: "wizardModeBootstrap"
PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardModeBootstrapView } PropertyChanges { target: wizardStateView; currentView: wizardStateView.wizardModeBootstrapView }
PropertyChanges { target: wizardFlickable; contentHeight: wizardStateView.wizardModeBootstrapView.childrenRect.height + wizardController.flickableHeightMargin }
} }
] ]
Flickable {
id: wizardFlickable
anchors.fill: parent
clip: true
ScrollBar.vertical: ScrollBar {
parent: wizardFlickable.parent
anchors.left: parent.right
anchors.leftMargin: 3
anchors.top: parent.top
anchors.topMargin: 4
anchors.bottom: parent.bottom
}
onFlickingChanged: {
releaseFocus();
}
StackView { StackView {
id: stackView id: stackView
initialItem: wizardStateView.wizardLanguageView initialItem: wizardStateView.wizardLanguageView
anchors.fill: parent anchors.fill: parent
clip: false clip: true
delegate: StackViewDelegate { delegate: StackViewDelegate {
pushTransition: StackViewTransition { pushTransition: StackViewTransition {
@ -255,6 +293,7 @@ Rectangle {
} }
} }
} }
}
//Open Wallet from file //Open Wallet from file
FileDialog { FileDialog {

View file

@ -48,6 +48,7 @@ ColumnLayout {
MoneroComponents.RadioButton { MoneroComponents.RadioButton {
id: localNode id: localNode
Layout.fillWidth: true
text: qsTr("Start a node automatically in background (recommended)") + translationManager.emptyString text: qsTr("Start a node automatically in background (recommended)") + translationManager.emptyString
fontSize: 16 * scaleRatio fontSize: 16 * scaleRatio
checked: !appWindow.persistentSettings.useRemoteNode && !isAndroid && !isIOS checked: !appWindow.persistentSettings.useRemoteNode && !isAndroid && !isIOS
@ -59,8 +60,8 @@ ColumnLayout {
} }
ColumnLayout { ColumnLayout {
visible: localNode.checked
id: blockchainFolderRow id: blockchainFolderRow
visible: localNode.checked
spacing: 20 * scaleRatio spacing: 20 * scaleRatio
Layout.topMargin: 8 * scaleRatio Layout.topMargin: 8 * scaleRatio
@ -148,7 +149,6 @@ ColumnLayout {
ColumnLayout { ColumnLayout {
spacing: 8 spacing: 8
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: 12 * scaleRatio
MoneroComponents.RemoteNodeEdit { MoneroComponents.RemoteNodeEdit {
id: bootstrapNodeEdit id: bootstrapNodeEdit
@ -176,10 +176,10 @@ ColumnLayout {
} }
} }
RowLayout {
MoneroComponents.RadioButton { MoneroComponents.RadioButton {
id: remoteNode id: remoteNode
Layout.fillWidth: true
Layout.topMargin: 8 * scaleRatio
text: qsTr("Connect to a remote node") + translationManager.emptyString text: qsTr("Connect to a remote node") + translationManager.emptyString
fontSize: 16 * scaleRatio fontSize: 16 * scaleRatio
checked: appWindow.persistentSettings.useRemoteNode checked: appWindow.persistentSettings.useRemoteNode
@ -188,13 +188,18 @@ ColumnLayout {
localNode.checked = false localNode.checked = false
} }
} }
}
RowLayout { ColumnLayout {
visible: remoteNode.checked
spacing: 0 * scaleRatio
Layout.topMargin: 8 * scaleRatio
Layout.fillWidth: true
MoneroComponents.RemoteNodeEdit { MoneroComponents.RemoteNodeEdit {
Layout.minimumWidth: 300 * scaleRatio
opacity: remoteNode.checked
id: remoteNodeEdit id: remoteNodeEdit
Layout.fillWidth: true
property var rna: persistentSettings.remoteNodeAddress property var rna: persistentSettings.remoteNodeAddress
daemonAddrText: rna.search(":") != -1 ? rna.split(":")[0].trim() : "" daemonAddrText: rna.search(":") != -1 ? rna.split(":")[0].trim() : ""
daemonPortText: rna.search(":") != -1 ? (rna.split(":")[1].trim() == "") ? appWindow.getDefaultDaemonRpcPort(persistentSettings.nettype) : persistentSettings.remoteNodeAddress.split(":")[1] : "" daemonPortText: rna.search(":") != -1 ? (rna.split(":")[1].trim() == "") ? appWindow.getDefaultDaemonRpcPort(persistentSettings.nettype) : persistentSettings.remoteNodeAddress.split(":")[1] : ""