diff options
| author | reemuru <rimuru@hiahatf.org> | 2022-03-12 19:24:08 -0500 |
|---|---|---|
| committer | reemuru <rimuru@hiahatf.org> | 2022-03-13 12:37:43 -0400 |
| commit | 346913f3db3512a254341d2576124787c5024198 (patch) | |
| tree | 71742fbbd97ac64c7c033af24c40a570fc17795a /components | |
| parent | fd8983a7ffe9e6825563243d01469898d1d30b45 (diff) | |
| download | monzero-gui-346913f3db3512a254341d2576124787c5024198.tar.gz monzero-gui-346913f3db3512a254341d2576124787c5024198.tar.xz monzero-gui-346913f3db3512a254341d2576124787c5024198.zip | |
SettingsWallet: lock wallet on demand
This commit adds the ability to lock the wallet on demand instead
of waiting for the user inactivity time out. It is binded to the
hot keys Ctrl+L. Pressing cancel or the esc key will send the user
back to the wizard home for wallet selection. Incorrect password
returns the error message. Correct password will remove the
PasswordDialog allowing access. Add lock functionality in the
wallet settings section and title bar.
Diffstat (limited to 'components')
| -rw-r--r-- | components/SettingsListItem.qml | 13 | ||||
| -rw-r--r-- | components/TitleBar.qml | 41 |
2 files changed, 54 insertions, 0 deletions
diff --git a/components/SettingsListItem.qml b/components/SettingsListItem.qml index d6a10ca6..7c778704 100644 --- a/components/SettingsListItem.qml +++ b/components/SettingsListItem.qml @@ -7,6 +7,7 @@ import "../components" as MoneroComponents ColumnLayout { id: settingsListItem property alias iconText: iconLabel.text + property alias symbol: symbolText.text property alias description: area.text property alias title: header.text property bool isLast: false @@ -114,5 +115,17 @@ ColumnLayout { settingsListItem.clicked() } } + + MoneroComponents.TextPlain { + id: symbolText + anchors.right: parent.right + anchors.rightMargin: 44 + anchors.verticalCenter: parent.verticalCenter + font.pixelSize: 12 + font.bold: true + color: MoneroComponents.Style.menuButtonTextColor + visible: appWindow.ctrlPressed + themeTransition: false + } } } diff --git a/components/TitleBar.qml b/components/TitleBar.qml index ef04fdf4..1720c457 100644 --- a/components/TitleBar.qml +++ b/components/TitleBar.qml @@ -57,6 +57,7 @@ Rectangle { signal minimizeClicked signal languageClicked signal closeWalletClicked + signal lockWalletClicked state: "default" states: [ @@ -91,6 +92,46 @@ Rectangle { spacing: 0 anchors.fill: parent + // lock wallet + Rectangle { + id: btnLockWallet + color: "transparent" + Layout.preferredWidth: parent.height + Layout.preferredHeight: parent.height + + Text { + text: FontAwesome.lock + font.family: FontAwesome.fontFamilySolid + font.pixelSize: 16 + color: MoneroComponents.Style.defaultFontColor + font.styleName: "Solid" + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + opacity: 0.75 + } + + MoneroComponents.Tooltip { + id: btnLockWalletTooltip + anchors.fill: parent + text: qsTr("Lock this wallet") + translationManager.emptyString + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onEntered: { + parent.color = MoneroComponents.Style.titleBarButtonHoverColor + btnLockWalletTooltip.tooltipPopup.open() + } + onExited: { + parent.color = "transparent" + btnLockWalletTooltip.tooltipPopup.close() + } + onClicked: root.lockWalletClicked(leftPanel.visible) + } + } + // collapse sidebar Rectangle { id: btnCloseWallet |
