aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-12-26 16:09:24 -0600
committerluigi1111 <luigi1111w@gmail.com>2018-12-26 16:09:24 -0600
commitf5b684811c3dc4073e89c2c2705e695121377a8d (patch)
tree051611b6643258665eb384f7a70258bfa5731f00 /components
parent1f2d2db1feba6164aa7fd3eb6bb1112a0877378c (diff)
parent548bc5f028544c66ff8731dbc51f32c6c7ed70c1 (diff)
downloadmonzero-gui-f5b684811c3dc4073e89c2c2705e695121377a8d.tar.gz
monzero-gui-f5b684811c3dc4073e89c2c2705e695121377a8d.tar.xz
monzero-gui-f5b684811c3dc4073e89c2c2705e695121377a8d.zip
Merge pull request #1854
548bc5f CheckBox: iconOnTheLeft property, optional uncheckedIcon and border, rich text format (xiphon)
Diffstat (limited to 'components')
-rw-r--r--components/CheckBox.qml16
1 files changed, 13 insertions, 3 deletions
diff --git a/components/CheckBox.qml b/components/CheckBox.qml
index 52f863e4..f341d730 100644
--- a/components/CheckBox.qml
+++ b/components/CheckBox.qml
@@ -38,8 +38,10 @@ Item {
property string uncheckedIcon
property bool checked: false
property alias background: backgroundRect.color
+ property bool border: true
property int fontSize: 14 * scaleRatio
property alias fontColor: label.color
+ property bool iconOnTheLeft: true
signal clicked()
height: 25 * scaleRatio
width: checkBoxLayout.width
@@ -51,6 +53,8 @@ Item {
RowLayout {
id: checkBoxLayout
+ layoutDirection: iconOnTheLeft ? Qt.LeftToRight : Qt.RightToLeft
+ spacing: (!isMobile ? 10 : 8) * scaleRatio
Item {
id: checkMark
@@ -68,12 +72,18 @@ Item {
} else {
return MoneroComponents.Style.inputBorderColorInActive;
}
+ visible: checkBox.border
}
Image {
anchors.centerIn: parent
- source: checkBox.checkedIcon
- visible: checkBox.checked
+ source: {
+ if (checkBox.checked || checkBox.uncheckedIcon == "") {
+ return checkBox.checkedIcon;
+ }
+ return checkBox.uncheckedIcon;
+ }
+ visible: checkBox.checked || checkBox.uncheckedIcon != ""
}
}
@@ -82,8 +92,8 @@ Item {
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: checkBox.fontSize
color: MoneroComponents.Style.defaultFontColor
+ textFormat: Text.RichText
wrapMode: Text.Wrap
- Layout.leftMargin: !isMobile ? 10 : 8
}
}