From ba06d46d680704012b4c8bf05b90912599edecee Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Tue, 1 Dec 2020 14:21:44 -0400 Subject: [PATCH] fix: menu icons and width on wallet module --- ui/app/AppLayouts/Wallet/WalletHeader.qml | 12 +++++-- .../Wallet/components/AddAccount.qml | 10 +++++- ui/app/img/add_remove_token.svg | 6 ++-- ui/app/img/add_watch_only.svg | 6 ++-- ui/app/img/currency.svg | 3 ++ ui/app/img/enter_private_key.svg | 6 ++-- ui/app/img/enter_seed_phrase.svg | 6 ++-- ui/app/img/generate_account.svg | 4 +-- ui/app/img/manage-wallet.svg | 3 ++ ui/shared/PopupMenu.qml | 31 +++++++++++-------- 10 files changed, 57 insertions(+), 30 deletions(-) create mode 100644 ui/app/img/currency.svg create mode 100644 ui/app/img/manage-wallet.svg diff --git a/ui/app/AppLayouts/Wallet/WalletHeader.qml b/ui/app/AppLayouts/Wallet/WalletHeader.qml index ef90eea410..7f5e703182 100644 --- a/ui/app/AppLayouts/Wallet/WalletHeader.qml +++ b/ui/app/AppLayouts/Wallet/WalletHeader.qml @@ -136,11 +136,13 @@ Item { PopupMenu { id: newSettingsMenu - width: 280 + width: 176 Action { //% "Account Settings" text: qsTrId("account-settings") - icon.source: "../../img/walletIcon.svg" + icon.source: "../../img/manage-wallet.svg" + icon.width: 16 + icon.height: 16 onTriggered: { accountSettingsModal.open() } @@ -149,6 +151,8 @@ Item { //% "Add/Remove Tokens" text: qsTrId("add/remove-tokens") icon.source: "../../img/add_remove_token.svg" + icon.width: 16 + icon.height: 16 onTriggered: { tokenSettingsModal.open() walletModel.loadCustomTokens() @@ -157,7 +161,9 @@ Item { Action { //% "Set Currency" text: qsTrId("set-currency") - icon.source: "../../img/globe.svg" + icon.source: "../../img/currency.svg" + icon.width: 16 + icon.height: 16 onTriggered: { setCurrencyModal.open() } diff --git a/ui/app/AppLayouts/Wallet/components/AddAccount.qml b/ui/app/AppLayouts/Wallet/components/AddAccount.qml index 750e7dad07..d912a2e17f 100644 --- a/ui/app/AppLayouts/Wallet/components/AddAccount.qml +++ b/ui/app/AppLayouts/Wallet/components/AddAccount.qml @@ -33,11 +33,13 @@ StatusRoundButton { PopupMenu { id: newAccountMenu - width: 280 + width: 260 Action { //% "Generate an account" text: qsTrId("generate-a-new-account") icon.source: "../../../img/generate_account.svg" + icon.width: 19 + icon.height: 19 onTriggered: { generateAccountModal.open() } @@ -46,6 +48,8 @@ StatusRoundButton { //% "Add a watch-only address" text: qsTrId("add-a-watch-account") icon.source: "../../../img/add_watch_only.svg" + icon.width: 19 + icon.height: 19 onTriggered: { addWatchOnlyAccountModal.open() } @@ -54,6 +58,8 @@ StatusRoundButton { //% "Enter a seed phrase" text: qsTrId("enter-a-seed-phrase") icon.source: "../../../img/enter_seed_phrase.svg" + icon.width: 19 + icon.height: 19 onTriggered: { addAccountWithSeedModal.open() } @@ -62,6 +68,8 @@ StatusRoundButton { //% "Enter a private key" text: qsTrId("enter-a-private-key") icon.source: "../../../img/enter_private_key.svg" + icon.width: 19 + icon.height: 19 onTriggered: { addAccountWithPrivateKeydModal.open() } diff --git a/ui/app/img/add_remove_token.svg b/ui/app/img/add_remove_token.svg index cd42850e20..b6ecc249a3 100644 --- a/ui/app/img/add_remove_token.svg +++ b/ui/app/img/add_remove_token.svg @@ -1,4 +1,4 @@ - - - + + + diff --git a/ui/app/img/add_watch_only.svg b/ui/app/img/add_watch_only.svg index 8af4f98cf3..12516e5a5c 100644 --- a/ui/app/img/add_watch_only.svg +++ b/ui/app/img/add_watch_only.svg @@ -1,4 +1,4 @@ - - - + + + diff --git a/ui/app/img/currency.svg b/ui/app/img/currency.svg new file mode 100644 index 0000000000..6ddc64260c --- /dev/null +++ b/ui/app/img/currency.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/app/img/enter_private_key.svg b/ui/app/img/enter_private_key.svg index 51967bfc71..e2eece7ba6 100644 --- a/ui/app/img/enter_private_key.svg +++ b/ui/app/img/enter_private_key.svg @@ -1,4 +1,4 @@ - - - + + + diff --git a/ui/app/img/enter_seed_phrase.svg b/ui/app/img/enter_seed_phrase.svg index a388fa9503..dcc7a3a0c3 100644 --- a/ui/app/img/enter_seed_phrase.svg +++ b/ui/app/img/enter_seed_phrase.svg @@ -1,3 +1,5 @@ - - + + + + diff --git a/ui/app/img/generate_account.svg b/ui/app/img/generate_account.svg index 9f75c2c7b3..3222874738 100644 --- a/ui/app/img/generate_account.svg +++ b/ui/app/img/generate_account.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ui/app/img/manage-wallet.svg b/ui/app/img/manage-wallet.svg new file mode 100644 index 0000000000..bbf2d8b63c --- /dev/null +++ b/ui/app/img/manage-wallet.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/shared/PopupMenu.qml b/ui/shared/PopupMenu.qml index 3d517dee3f..16b9954f83 100644 --- a/ui/shared/PopupMenu.qml +++ b/ui/shared/PopupMenu.qml @@ -58,7 +58,7 @@ Menu { width: 9 fillMode: Image.PreserveAspectFit visible: popupMenuItem.subMenu - + ColorOverlay { anchors.fill: parent source: parent @@ -67,23 +67,28 @@ Menu { } // FIXME the icons looks very pixelated on Linux for some reason. Using smooth, mipmap, etc doesn't fix it - indicator: Image { - id: menuIcon - source: popupMenuItem.icon.source - anchors.left: parent.left - anchors.leftMargin: Style.current.padding - anchors.verticalCenter: parent.verticalCenter + indicator: Item { visible: !!popupMenuItem.icon.source.toString() width: !isNaN(popupMenuItem.icon.width) ? popupMenuItem.icon.width : 25 height: !isNaN(popupMenuItem.icon.height) ? popupMenuItem.icon.height : 25 - sourceSize.width: width - sourceSize.height: height - antialiasing: true + anchors.left: parent.left + anchors.leftMargin: Style.current.padding + anchors.verticalCenter: parent.verticalCenter + + Image { + id: menuIcon + source: popupMenuItem.icon.source + visible: false + width: parent.width + height: parent.width + sourceSize.width: width + sourceSize.height: height + } ColorOverlay { - anchors.fill: parent - source: parent - antialiasing: true + anchors.fill: menuIcon + source: menuIcon + smooth: true color: popupMenuItem.highlighted ? Style.current.primaryMenuItemTextHover : (popupMenuItem.action.icon.color != "#00000000" ? popupMenuItem.action.icon.color : Style.current.primaryMenuItemHover)