diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2019-04-25 13:05:54 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2019-04-25 13:05:54 -0500 |
| commit | fb4dfd0ea8a09999a7433e4d0d9ad1aa5009821d (patch) | |
| tree | cbbe7fc3e3950354f7a4dcb925b6e1e9dc62efd8 /components/CheckBox.qml | |
| parent | 358e1d23facbd10fefbb2bf04c45b98f0c728ad0 (diff) | |
| parent | 42f7afaefddbf5a7929ddf88dbe7b27e7f40a669 (diff) | |
| download | monzero-gui-fb4dfd0ea8a09999a7433e4d0d9ad1aa5009821d.tar.gz monzero-gui-fb4dfd0ea8a09999a7433e4d0d9ad1aa5009821d.tar.xz monzero-gui-fb4dfd0ea8a09999a7433e4d0d9ad1aa5009821d.zip | |
Merge pull request #2060
42f7afa White theme (xmrdsc)
Diffstat (limited to 'components/CheckBox.qml')
| -rw-r--r-- | components/CheckBox.qml | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/components/CheckBox.qml b/components/CheckBox.qml index f341d730..15648d3e 100644 --- a/components/CheckBox.qml +++ b/components/CheckBox.qml @@ -26,16 +26,20 @@ // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Layouts 1.1 +import FontAwesome 1.0 -import "../components" as MoneroComponents +import "." as MoneroComponents +import "effects/" as MoneroEffects Item { id: checkBox property alias text: label.text - property string checkedIcon: "../images/checkedIcon-black.png" + property string checkedIcon: "qrc:///images/check-white.svg" property string uncheckedIcon + property int imgWidth: 13 * scaleRatio + property int imgHeight: 13 * scaleRatio property bool checked: false property alias background: backgroundRect.color property bool border: true @@ -63,6 +67,7 @@ Item { Rectangle { id: backgroundRect + visible: checkBox.border anchors.fill: parent radius: 3 color: "transparent" @@ -72,22 +77,26 @@ Item { } else { return MoneroComponents.Style.inputBorderColorInActive; } - visible: checkBox.border } - Image { + MoneroEffects.ImageMask { + id: img + visible: checkBox.checked || checkBox.uncheckedIcon != "" anchors.centerIn: parent - source: { - if (checkBox.checked || checkBox.uncheckedIcon == "") { + width: checkBox.imgWidth + height: checkBox.imgHeight + color: MoneroComponents.Style.defaultFontColor + fontAwesomeFallbackIcon: FontAwesome.plus + fontAwesomeFallbackSize: 14 + image: { + if (checkBox.checked || checkBox.uncheckedIcon == "") return checkBox.checkedIcon; - } return checkBox.uncheckedIcon; } - visible: checkBox.checked || checkBox.uncheckedIcon != "" } } - Text { + MoneroComponents.TextPlain { id: label font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: checkBox.fontSize |
