diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2017-11-03 15:29:10 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2017-11-03 15:29:10 -0500 |
| commit | c58dfa913bb356368e12dc5248c4f5acdfe3934d (patch) | |
| tree | b50d0010ac51fa44405bcaec573dab03236ff9cb /components/CheckBox.qml | |
| parent | 6f95f8a7545bbdc25750412c54a92ddc5224b3ad (diff) | |
| parent | ceeb9b667fa35f92054c79942b593337fadcd08b (diff) | |
| download | monzero-gui-c58dfa913bb356368e12dc5248c4f5acdfe3934d.tar.gz monzero-gui-c58dfa913bb356368e12dc5248c4f5acdfe3934d.tar.xz monzero-gui-c58dfa913bb356368e12dc5248c4f5acdfe3934d.zip | |
Merge pull request #826
Remote nodes + mobile layout
Diffstat (limited to 'components/CheckBox.qml')
| -rw-r--r-- | components/CheckBox.qml | 91 |
1 files changed, 50 insertions, 41 deletions
diff --git a/components/CheckBox.qml b/components/CheckBox.qml index ffe585c3..267106b1 100644 --- a/components/CheckBox.qml +++ b/components/CheckBox.qml @@ -29,61 +29,70 @@ import QtQuick 2.0 import QtQuick.Layouts 1.1 -Item { +RowLayout { id: checkBox property alias text: label.text property string checkedIcon property string uncheckedIcon property bool checked: false property alias background: backgroundRect.color - property int fontSize: 14 + property int fontSize: 14 * scaleRatio property alias fontColor: label.color signal clicked() - height: 25 - width: label.x + label.width - Layout.minimumWidth: label.x + label.contentWidth - clip: true + height: 25 * scaleRatio - Rectangle { - anchors.left: parent.left - height: parent.height - 1 - width: 25 - //radius: 4 - y: 0 - color: "#DBDBDB" + function toggle(){ + checkBox.checked = !checkBox.checked + checkBox.clicked() } - Rectangle { - id: backgroundRect - anchors.left: parent.left - height: parent.height - 1 - width: 25 - //radius: 4 - y: 1 - color: "#FFFFFF" - - Image { - anchors.centerIn: parent - source: checkBox.checked ? checkBox.checkedIcon : - checkBox.uncheckedIcon + RowLayout { + Layout.fillWidth: true + Rectangle { + anchors.left: parent.left + width: 25 * scaleRatio + height: checkBox.height - 1 + //radius: 4 + y: 0 + color: "#DBDBDB" } - } - Text { - id: label - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: 25 + 12 - font.family: "Arial" - font.pixelSize: checkBox.fontSize - color: "#525252" - } + Rectangle { + id: backgroundRect + anchors.left: parent.left + width: 25 * scaleRatio + height: checkBox.height - 1 + //radius: 4 + y: 1 + color: "#FFFFFF" + + Image { + anchors.centerIn: parent + source: checkBox.checked ? checkBox.checkedIcon : + checkBox.uncheckedIcon + } + + MouseArea { + anchors.fill: parent + onClicked: { + toggle() + } + } + } - MouseArea { - anchors.fill: parent - onClicked: { - checkBox.checked = !checkBox.checked - checkBox.clicked() + Text { + id: label + font.family: "Arial" + font.pixelSize: checkBox.fontSize + color: "#525252" + wrapMode: Text.Wrap + Layout.fillWidth: true + MouseArea { + anchors.fill: parent + onClicked: { + toggle() + } + } } } } |
