From d9495275cc8ff0dc701486349ecfe1c82cd75b11 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Fri, 7 Sep 2018 11:22:31 -0700 Subject: [PATCH] adding cancel button and signed in checkbox --- interface/resources/qml/LoginDialog.qml | 1 + .../qml/LoginDialog/LinkAccountBody.qml | 23 ++++++++++++++----- .../resources/qml/windows/ModalFrame.qml | 18 +++++++++++++++ .../resources/qml/windows/ModalWindow.qml | 1 + 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/interface/resources/qml/LoginDialog.qml b/interface/resources/qml/LoginDialog.qml index e21e8b7354..336858502d 100644 --- a/interface/resources/qml/LoginDialog.qml +++ b/interface/resources/qml/LoginDialog.qml @@ -23,6 +23,7 @@ ModalWindow { objectName: "LoginDialog" implicitWidth: 520 implicitHeight: 320 + closeButtonVisible: true destroyOnCloseButton: true destroyOnHidden: true visible: true diff --git a/interface/resources/qml/LoginDialog/LinkAccountBody.qml b/interface/resources/qml/LoginDialog/LinkAccountBody.qml index 2274d88e04..4c9fe6ae94 100644 --- a/interface/resources/qml/LoginDialog/LinkAccountBody.qml +++ b/interface/resources/qml/LoginDialog/LinkAccountBody.qml @@ -234,6 +234,23 @@ Item { onHeightChanged: d.resize(); onWidthChanged: d.resize(); anchors.horizontalCenter: parent.horizontalCenter + CheckBox { + id: autoLogoutCheckbox; + checked: Settings.getValue("wallet/autoLogout", true); + text: "Keep me signed in" + boxSize: 20; + labelFontSize: 15; + color: hifi.colors.black; + onCheckedChanged: { + Settings.setValue("wallet/autoLogout", !checked); + if (checked) { + Settings.setValue("wallet/savedUsername", ""); + } else { + Settings.setValue("wallet/savedUsername", Account.username); + } + } + } + Button { id: linkAccountButton anchors.verticalCenter: parent.verticalCenter @@ -244,12 +261,6 @@ Item { onClicked: linkAccountBody.login() } - - Button { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Cancel") - onClicked: root.tryDestroy() - } } Row { diff --git a/interface/resources/qml/windows/ModalFrame.qml b/interface/resources/qml/windows/ModalFrame.qml index 211353b5f3..640069a0b3 100644 --- a/interface/resources/qml/windows/ModalFrame.qml +++ b/interface/resources/qml/windows/ModalFrame.qml @@ -94,5 +94,23 @@ Frame { color: hifi.colors.lightGray } } + + + GlyphButton { + id: closeButton + visible: window.closeButtonVisible + width: 30 + y: -hifi.dimensions.modalDialogTitleHeight + anchors { + top: parent.top + right: parent.right + topMargin: 10 + rightMargin: 10 + } + glyph: hifi.glyphs.close + onClicked: { + window.destroy(); + } + } } } diff --git a/interface/resources/qml/windows/ModalWindow.qml b/interface/resources/qml/windows/ModalWindow.qml index 2d56099051..75f5c2d646 100644 --- a/interface/resources/qml/windows/ModalWindow.qml +++ b/interface/resources/qml/windows/ModalWindow.qml @@ -19,6 +19,7 @@ ScrollingWindow { destroyOnHidden: true frame: ModalFrame { } + property bool closeButtonVisible: false property int colorScheme: hifi.colorSchemes.light property bool draggable: false