From c328f332f6b5685c1ce03cbb7c0fec13e2c0338a Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Thu, 14 Jan 2021 11:18:12 +0100 Subject: [PATCH] fix(Wallet): fix bug that prevented users from setting the currency Setting the default currency through the UI doesn't work because of a `MouseArea` that is masking the an underlying `StatusRadioButton` which will tricker the default currency change. This commit enhances the `MouseArea` to trigger the default currency change and it also ensures the UI is responding accordingly. Namely that the new default currency is correcly selected in the list of currencies. There's also a little change in the background hover color so it works well across light and dark themes. Fixes #1632 --- .../Wallet/components/SetCurrencyModalContent.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/app/AppLayouts/Wallet/components/SetCurrencyModalContent.qml b/ui/app/AppLayouts/Wallet/components/SetCurrencyModalContent.qml index aac0cea923..25f0addf08 100644 --- a/ui/app/AppLayouts/Wallet/components/SetCurrencyModalContent.qml +++ b/ui/app/AppLayouts/Wallet/components/SetCurrencyModalContent.qml @@ -35,7 +35,7 @@ Item { id: wrapper property bool hovered: false radius: Style.current.radius - color: currency === key ? Style.current.lightBlue : (hovered ? Style.current.grey: Style.current.transparent) + color: modalBody.currency === key ? Style.current.lightBlue : (hovered ? Style.current.backgroundHover: Style.current.transparent) anchors.right: parent.right anchors.rightMargin: 0 anchors.left: parent.left @@ -52,6 +52,7 @@ Item { } StatusRadioButton { + id: currencyRadioBtn checked: currency === key isHovered: wrapper.hovered anchors.right: parent.right @@ -63,6 +64,7 @@ Item { MouseArea { anchors.fill: parent + cursorShape: Qt.PointingHandCursor hoverEnabled: true onEntered: { wrapper.hovered = true @@ -70,6 +72,11 @@ Item { onExited: { wrapper.hovered = false } + onClicked: { + currencyRadioBtn.checked = !currencyRadioBtn.checked + modalBody.currency = key + walletModel.setDefaultCurrency(key) + } } } }