From 5b5ed517c22e36807eefa0506389f469d3709fcd Mon Sep 17 00:00:00 2001 From: Borgbyte Date: Fri, 15 Jul 2022 12:46:38 +0100 Subject: [PATCH] ui: add support section in general settings --- CHANGELOG.md | 1 + qml/AccountIdBadge.qml | 3 ++- qml/CopyableLabel.qml | 9 +++++---- qml/WalletGeneralSettingsView.qml | 13 +++++++++++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b741c58..92ae5b46d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added - Enable list addresses and coins on Singlesig wallets +- Support section in general settings to copy Support ID ### Changed - Enable watch-only login for multisig shield liquid wallets diff --git a/qml/AccountIdBadge.qml b/qml/AccountIdBadge.qml index 37d96dfcb..be669d7ed 100644 --- a/qml/AccountIdBadge.qml +++ b/qml/AccountIdBadge.qml @@ -7,6 +7,7 @@ import QtQuick.Layouts 1.13 Button { id: self required property Account account + property bool amp: true leftInset: 0 rightInset: 0 topInset: 0 @@ -25,7 +26,7 @@ Button { spacing: 8 Label { Layout.fillWidth: true - text: qsTrId('id_amp_id') + text: self.amp ? qsTrId('id_amp_id') : qsTrId('Support ID') font.styleName: 'Regular' } Label { diff --git a/qml/CopyableLabel.qml b/qml/CopyableLabel.qml index f39ec8b9f..0065ff39c 100644 --- a/qml/CopyableLabel.qml +++ b/qml/CopyableLabel.qml @@ -5,14 +5,15 @@ import QtQuick.Controls 2.13 Label { property real delay: 500 property string copyText: text + function copy() { + Clipboard.copy(self.copyText) + ToolTip.show(qsTrId('id_copied_to_clipboard'), 1000) + } id: self background: MouseArea { id: mouse_area hoverEnabled: true - onClicked: { - Clipboard.copy(self.copyText) - ToolTip.show(qsTrId('id_copied_to_clipboard'), 1000) - } + onClicked: copy() Rectangle { anchors.fill: parent anchors.margins: -4 diff --git a/qml/WalletGeneralSettingsView.qml b/qml/WalletGeneralSettingsView.qml index c86b18d90..2aaff2c71 100644 --- a/qml/WalletGeneralSettingsView.qml +++ b/qml/WalletGeneralSettingsView.qml @@ -179,4 +179,17 @@ ColumnLayout { } } } + + Loader { + Layout.fillWidth: true + active: !wallet.network.electrum + visible: active + sourceComponent: SettingsBox { + title: qsTrId('id_support') + contentItem: AccountIdBadge { + amp: false + account: wallet.accounts[0] + } + } + } }