-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPrefsCheckboxLable.qml
78 lines (75 loc) · 2.58 KB
/
PrefsCheckboxLable.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.3
import FontStyle 1.0
import AppStyle 1.0
import "../"
import "./"
ColumnLayout{
id:root
Layout.fillWidth: true
property bool isBold: false
property alias checked: control.checked
property string title: qsTr("Format Secure Notes Using Markdown")
property string description: qsTr("Example APP demonstrating Qt Quick Controls 2")
spacing: 5
CheckBox {
id: control
text: title
checked: true
spacing: 15
contentItem:Label{
width: root.width
Layout.rightMargin: 10
leftPadding: indicatorRect.implicitWidth + control.spacing
text: control.text
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.family: FontStyle.getContentFont.name
font.pixelSize: isBold ? AppStyle.t1 : AppStyle.t1
font.bold: isBold ? Font.Bold : Font.Normal
font.weight: isBold ? Font.Bold : Font.Normal
}
indicator: Rectangle {
id:indicatorRect
implicitWidth: 22
implicitHeight: 22
x: control.leftPadding
y: parent.height / 2 - height / 2
radius: 5
color: control.checked ? AppStyle.applicationColor : checkBoxHover.hovered ? "#dde4de" : "transparent"
border.width: 1
border.color: control.checked ? AppStyle.applicationColor : "grey"
HoverHandler{
id:checkBoxHover
}
Label{
text: "+"
color: "white"
visible:control.checked
font.family: FontStyle.getAwesomeRegular.name
font.pixelSize: isBold ? AppStyle.t1 : AppStyle.t1
font.bold: isBold ? Font.Bold : Font.Normal
font.weight: isBold ? Font.Bold : Font.Normal
anchors.centerIn: parent
bottomInset: 2
}
}
}
Label{
Layout.fillWidth: true
width: root.width
leftPadding: control.spacing + 22 + spacing
rightPadding: 10
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.family: FontStyle.getContentFont.name
font.pixelSize: isBold ? AppStyle.t1 : AppStyle.t1
font.bold: isBold ? Font.Bold : Font.Normal
font.weight: isBold ? Font.Bold : Font.Normal
text:description
// Open the link in a browser when clicked
onLinkActivated: {
Qt.openUrlExternally(link)
}
}
}