2019-11-11 22:06:30 +01:00
|
|
|
import QtQuick 2.9
|
|
|
|
import QtQuick.Layouts 1.1
|
2019-12-21 14:37:15 +01:00
|
|
|
import FontAwesome 1.0
|
2019-11-11 22:06:30 +01:00
|
|
|
|
|
|
|
import "../components" as MoneroComponents
|
|
|
|
|
|
|
|
ColumnLayout {
|
2019-12-21 14:37:15 +01:00
|
|
|
id: settingsListItem
|
|
|
|
property alias iconText: iconLabel.text
|
|
|
|
property alias description: area.text
|
|
|
|
property alias title: header.text
|
|
|
|
property bool isLast: false
|
2019-11-11 22:06:30 +01:00
|
|
|
signal clicked()
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
Rectangle {
|
2019-12-21 14:37:15 +01:00
|
|
|
id: root
|
2019-11-11 22:06:30 +01:00
|
|
|
Layout.fillWidth: true
|
2019-12-21 14:37:15 +01:00
|
|
|
Layout.minimumHeight: 75
|
|
|
|
Layout.preferredHeight: rect.height + 15
|
|
|
|
color: "transparent"
|
2019-11-11 22:06:30 +01:00
|
|
|
|
2019-12-21 14:37:15 +01:00
|
|
|
Rectangle {
|
|
|
|
id: divider
|
|
|
|
anchors.topMargin: 0
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: 1
|
|
|
|
color: MoneroComponents.Style.dividerColor
|
|
|
|
opacity: MoneroComponents.Style.dividerOpacity
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: rect
|
|
|
|
width: parent.width
|
|
|
|
height: header.height + area.contentHeight
|
|
|
|
color: "transparent";
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.bottomMargin: 4
|
|
|
|
anchors.topMargin: 4
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2019-11-11 22:06:30 +01:00
|
|
|
|
2019-12-21 14:37:15 +01:00
|
|
|
Rectangle {
|
|
|
|
id: icon
|
|
|
|
color: "transparent"
|
|
|
|
height: 32
|
|
|
|
width: 32
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 16
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
MoneroComponents.Label {
|
|
|
|
id: iconLabel
|
|
|
|
fontSize: 32
|
|
|
|
fontFamily: FontAwesome.fontFamilySolid
|
|
|
|
anchors.centerIn: parent
|
|
|
|
fontColor: MoneroComponents.Style.defaultFontColor
|
|
|
|
styleName: "Solid"
|
|
|
|
}
|
|
|
|
}
|
2019-11-11 22:06:30 +01:00
|
|
|
|
|
|
|
MoneroComponents.TextPlain {
|
2019-12-21 14:37:15 +01:00
|
|
|
id: header
|
|
|
|
anchors.left: icon.right
|
|
|
|
anchors.leftMargin: 16
|
|
|
|
anchors.top: parent.top
|
2019-11-11 22:06:30 +01:00
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
opacity: MoneroComponents.Style.blackTheme ? 1.0 : 0.8
|
|
|
|
font.bold: true
|
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
|
|
|
font.pixelSize: 16
|
|
|
|
}
|
|
|
|
|
2019-12-21 14:37:15 +01:00
|
|
|
Text {
|
|
|
|
id: area
|
|
|
|
anchors.top: header.bottom
|
|
|
|
anchors.topMargin: 4
|
|
|
|
anchors.left: icon.right
|
|
|
|
anchors.leftMargin: 16
|
2019-11-11 22:06:30 +01:00
|
|
|
color: MoneroComponents.Style.dimmedFontColor
|
2019-12-21 14:37:15 +01:00
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
|
|
|
font.pixelSize: 15
|
2019-11-11 22:06:30 +01:00
|
|
|
horizontalAlignment: TextInput.AlignLeft
|
2019-12-21 14:37:15 +01:00
|
|
|
wrapMode: Text.WordWrap;
|
|
|
|
leftPadding: 0
|
|
|
|
topPadding: 0
|
|
|
|
width: parent.width - (icon.width + icon.anchors.leftMargin + anchors.leftMargin)
|
2019-11-11 22:06:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-21 14:37:15 +01:00
|
|
|
Rectangle {
|
|
|
|
id: bottomDivider
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: 1
|
|
|
|
color: MoneroComponents.Style.dividerColor
|
|
|
|
opacity: MoneroComponents.Style.dividerOpacity
|
|
|
|
visible: settingsListItem.isLast
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: root.color = MoneroComponents.Style.titleBarButtonHoverColor
|
|
|
|
onExited: root.color = "transparent"
|
2019-11-11 22:06:30 +01:00
|
|
|
onClicked: {
|
|
|
|
settingsListItem.clicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|