From 0daf2aacf560b85e1c5660e8dc749ce98b96dc47 Mon Sep 17 00:00:00 2001 From: xiphon Date: Mon, 25 Nov 2019 05:52:13 +0000 Subject: [PATCH] CheckBox: use Font Awesome plus/minus icons, remove unused images --- components/CheckBox.qml | 7 +++++-- components/effects/ImageMask.qml | 7 +++---- images/minus-white.png | Bin 170 -> 0 bytes images/minus-white@2x.png | Bin 170 -> 0 bytes images/plus-in-circle-medium-white.png | Bin 399 -> 0 bytes images/plus-in-circle-medium-white@2x.png | Bin 760 -> 0 bytes images/plus-white.png | Bin 193 -> 0 bytes images/plus-white@2x.png | Bin 195 -> 0 bytes pages/Account.qml | 6 ++++-- pages/AddressBook.qml | 5 +++-- pages/Receive.qml | 5 +++-- pages/Transfer.qml | 10 ++++++---- qml.qrc | 6 ------ 13 files changed, 24 insertions(+), 22 deletions(-) delete mode 100644 images/minus-white.png delete mode 100644 images/minus-white@2x.png delete mode 100755 images/plus-in-circle-medium-white.png delete mode 100755 images/plus-in-circle-medium-white@2x.png delete mode 100644 images/plus-white.png delete mode 100644 images/plus-white@2x.png diff --git a/components/CheckBox.qml b/components/CheckBox.qml index 99ea6416..4ef1aae8 100644 --- a/components/CheckBox.qml +++ b/components/CheckBox.qml @@ -38,6 +38,7 @@ Item { property alias text: label.text property string checkedIcon: "qrc:///images/check-white.svg" property string uncheckedIcon + property bool fontAwesomeIcons: false property int imgWidth: 13 property int imgHeight: 13 property bool toggleOnClick: true @@ -89,9 +90,11 @@ Item { width: checkBox.imgWidth height: checkBox.imgHeight color: MoneroComponents.Style.defaultFontColor - fontAwesomeFallbackIcon: FontAwesome.plus + fontAwesomeFallbackIcon: checkBox.fontAwesomeIcons ? getIcon() : FontAwesome.plus fontAwesomeFallbackSize: 14 - image: { + image: checkBox.fontAwesomeIcons ? "" : getIcon() + + function getIcon() { if (checkBox.checked || checkBox.uncheckedIcon == "") return checkBox.checkedIcon; return checkBox.uncheckedIcon; diff --git a/components/effects/ImageMask.qml b/components/effects/ImageMask.qml index 4ac751ff..ea6d84c4 100644 --- a/components/effects/ImageMask.qml +++ b/components/effects/ImageMask.qml @@ -39,7 +39,6 @@ Item { id: root property string image: "" property string color: "" - property bool fontAwesomeFallbackEnabled: true property var fontAwesomeFallbackIcon: "" property string fontAwesomeFallbackFont: FontAwesome.fontFamilySolid property string fontAwesomeFallbackStyle: "Solid" @@ -69,13 +68,13 @@ Item { anchors.fill: root source: svgMask color: root.color - visible: isOpenGL + visible: image && isOpenGL } Text { id: fontAwesomeFallback - visible: !isOpenGL && root.fontAwesomeFallback - text: !isOpenGL ? root.fontAwesomeFallbackIcon : "" + visible: !imgMockColor.visible + text: root.fontAwesomeFallbackIcon font.family: root.fontAwesomeFallbackFont font.pixelSize: root.fontAwesomeFallbackSize font.styleName: root.fontAwesomeFallbackStyle diff --git a/images/minus-white.png b/images/minus-white.png deleted file mode 100644 index b42bee8e1cfcae55d0901c1e4037e15794455658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kmSQK*5Dp-y;YjHK@;M7UB8wRq z#8g3;(KATp15i-1#5JNMI6tkVJh3R1p}f3YFEcN@I61K(RWH9NefB#WDWD>CPZ!4! zjfu$#62BTg{{R14nJ z=y-xKPx$Nl8ROR5%f>l}%0pK@f#$H11r0I}Tv*3@nXYfrO*D@-!q~LBoH2+Cb@dc(^b0jjb0PEGc&78(!VWrXaRoc)PG*mXi;@WfyOX#S zPf}l^ze|4==)P@_fC3uJaW7u91O6cI6tflZnOHyqm4J~;0pxn}fY#=JD+?H$3&R+V zB`^T)tcx~s!d>(L)}%&Cn>py}(1)UmmI3?_ zXWya?pzlXn7L{KPN?^mR`Z9X_&${cqpE81i*&3y^GmLNBW-GK3P`|!HC2=1HgSEeu tp1o6x<=$UHWg-6uAP#}Dfr|bDJ^`snUer29`9S~x002ovPDHLkV1jagsQUl_ diff --git a/images/plus-in-circle-medium-white@2x.png b/images/plus-in-circle-medium-white@2x.png deleted file mode 100755 index c4c3af906e9fe81819cc67071959402ea35a437d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 760 zcmVPx%vPnciR9FeknZHWxKop0QMQwBu6a=j-1QmNhEH2g}+()=CpwHkl_#}c@i-idG zqJo8$7X$@aZM?A1uWMg6`6SFyRHj|k-XTF_($(h7aO&Jb{bC|B8OK9IwlF`7? zN78q39KWc*S7ILnpr)z6iLRpyKDN|-LT}J3VBf3SRssZU3WrP2&$$f1$jy#rNV8Kw z3bcJ_wT@eMEsNopaA>s8g={7F*q>N`dt6s++V>&`v6z)@dJy7iGPDVY$O)_PRf>}Y zw64Ex%aqPRJ-&jT5Eje;x#^mOVi8jcsKwDWF-$$WQg0=`5B@g(%!1f72iMwYt!5i* z0$i+V+=khr0QIujRq4l!^FDO*6$s5f7rH`eZC%I73`m$0-Y_Rg?lFIQf;Zt zoTQ5+S3(90r<=!bE-aAUJ-|#r?H1I{Bj5y5S3q?{qKIF;>KjY{+#xzJIRRDyzhY{I qt%?j2C7JmQq1U-vR%ory5dQ(~5XM(vrEiS@0000nVFfJZKu>uXl#7Qu&eFANvRMwGqba@ grr#k3X9GEg+50p<$Efen0Gh<$>FVdQ&MBb@0NJ)Tn*aa+ diff --git a/images/plus-white@2x.png b/images/plus-white@2x.png deleted file mode 100644 index 54611b87e159e179598557266828922031132b56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEX7WqAsj$Z!;#Vf4nJ z=y-!L<5JscD}jQNC9V-A!TD(=<%vb94CUqJdYO6I#mR{Use1WE>9gP2NC6c&c)B=- zcyuPGC@}r`|Np>S)IgbDU diff --git a/pages/Account.qml b/pages/Account.qml index dffc2eb8..13c2b1cf 100644 --- a/pages/Account.qml +++ b/pages/Account.qml @@ -31,6 +31,7 @@ import QtQuick.Controls 2.0 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.2 +import FontAwesome 1.0 import "../components" as MoneroComponents import "../components/effects/" as MoneroEffects @@ -349,8 +350,9 @@ Rectangle { id: addNewAccountCheckbox visible: !selectAndSend border: false - checkedIcon: "qrc:///images/plus-in-circle-medium-white.png" - uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png" + uncheckedIcon: FontAwesome.plusCircle + toggleOnClick: false + fontAwesomeIcons: true fontSize: 16 iconOnTheLeft: true Layout.fillWidth: true diff --git a/pages/AddressBook.qml b/pages/AddressBook.qml index 5812dac5..6c910f4c 100644 --- a/pages/AddressBook.qml +++ b/pages/AddressBook.qml @@ -284,8 +284,9 @@ Rectangle { MoneroComponents.CheckBox { id: addNewEntryCheckbox border: false - checkedIcon: "qrc:///images/plus-in-circle-medium-white.png" - uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png" + uncheckedIcon: FontAwesome.plusCircle + toggleOnClick: false + fontAwesomeIcons: true fontSize: 16 iconOnTheLeft: true Layout.fillWidth: true diff --git a/pages/Receive.qml b/pages/Receive.qml index 6d3ee060..1cbfff42 100644 --- a/pages/Receive.qml +++ b/pages/Receive.qml @@ -244,8 +244,9 @@ Rectangle { MoneroComponents.CheckBox { id: addNewAddressCheckbox border: false - checkedIcon: "qrc:///images/plus-in-circle-medium-white.png" - uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png" + uncheckedIcon: FontAwesome.plusCircle + toggleOnClick: false + fontAwesomeIcons: true fontSize: 16 iconOnTheLeft: true Layout.fillWidth: true diff --git a/pages/Transfer.qml b/pages/Transfer.qml index f5f8cb2a..4f11b744 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -343,8 +343,9 @@ Rectangle { CheckBox { id: descriptionCheckbox border: false - checkedIcon: "qrc:///images/plus-in-circle-medium-white.png" - uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png" + checkedIcon: FontAwesome.minusCircle + uncheckedIcon: FontAwesome.plusCircle + fontAwesomeIcons: true fontSize: descriptionLine.labelFontSize iconOnTheLeft: true Layout.fillWidth: true @@ -370,8 +371,9 @@ Rectangle { CheckBox { id: paymentIdCheckbox border: false - checkedIcon: "qrc:///images/plus-in-circle-medium-white.png" - uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png" + checkedIcon: FontAwesome.minusCircle + uncheckedIcon: FontAwesome.plusCircle + fontAwesomeIcons: true fontSize: paymentIdLine.labelFontSize iconOnTheLeft: true Layout.fillWidth: true diff --git a/qml.qrc b/qml.qrc index 1ad92107..eb312bef 100644 --- a/qml.qrc +++ b/qml.qrc @@ -7,10 +7,6 @@ images/download-white@2x.png images/external-link-white.png images/external-link-white@2x.png - images/minus-white.png - images/minus-white@2x.png - images/plus-white.png - images/plus-white@2x.png components/Label.qml components/SettingsListItem.qml images/whatIsIcon.png @@ -174,8 +170,6 @@ components/WarningBox.qml images/miningxmr.png images/miningxmr@2x.png - images/plus-in-circle-medium-white.png - images/plus-in-circle-medium-white@2x.png pages/merchant/Merchant.qml pages/merchant/MerchantCheckbox.qml pages/merchant/MerchantTrackingList.qml