From 58e292e9ab297cd97ba7bde4deac185d9d112e4b Mon Sep 17 00:00:00 2001 From: Eric Mastro Date: Wed, 21 Apr 2021 17:39:05 +1000 Subject: [PATCH] fix: Add close button to seed backup warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: #2248. Add a close button to the seed backup warning banner in the wallet. The banner will reappear upon application restart as long as the seed hasn’t already been backed up (`profileModel.mnemonic.isBackedUp`). A new .svg with a white outline needed to be added as well because the original “close.svg” had a purple outline, which would show up when the ColorOverlay applied to the close button had an opacity less than 1.0. --- .../Wallet/SeedPhraseBackupWarning.qml | 28 +++++++++++++++++++ ui/app/img/close-white.svg | 4 +++ 2 files changed, 32 insertions(+) create mode 100644 ui/app/img/close-white.svg diff --git a/ui/app/AppLayouts/Wallet/SeedPhraseBackupWarning.qml b/ui/app/AppLayouts/Wallet/SeedPhraseBackupWarning.qml index e7ccd75090..1aeab247fd 100644 --- a/ui/app/AppLayouts/Wallet/SeedPhraseBackupWarning.qml +++ b/ui/app/AppLayouts/Wallet/SeedPhraseBackupWarning.qml @@ -1,16 +1,19 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 +import QtGraphicalEffects 1.13 import "../../../imports" import "../../../shared" import "../Profile/Sections" import "." Rectangle { + id: root visible: !profileModel.mnemonic.isBackedUp height: visible ? 32 : 0 Layout.fillWidth: true color: Style.current.red + Row { spacing: Style.current.halfPadding anchors.horizontalCenter: parent.horizontalCenter @@ -57,6 +60,31 @@ Rectangle { } } + SVGImage { + id: closeImg + anchors.top: parent.top + anchors.topMargin: 6 + anchors.right: parent.right + anchors.rightMargin: 18 + source: "../../img/close-white.svg" + height: 20 + width: 20 + } + ColorOverlay { + anchors.fill: closeImg + source: closeImg + color: Style.current.white + opacity: 0.7 + } + MouseArea { + anchors.fill: closeImg + cursorShape: Qt.PointingHandCursor + onClicked: ParallelAnimation { + PropertyAnimation { target: root; property: "visible"; to: false; } + PropertyAnimation { target: root; property: "y"; to: -1 * root.height } + } + } + BackupSeedModal { id: backupSeedModal diff --git a/ui/app/img/close-white.svg b/ui/app/img/close-white.svg new file mode 100644 index 0000000000..e9bd2f626a --- /dev/null +++ b/ui/app/img/close-white.svg @@ -0,0 +1,4 @@ + + + +