AusweisApp2/resources/qml/Governikus/ProviderView/CategoryCheckbox_tablet.qml

50 lines
1.0 KiB
QML
Raw Normal View History

2017-07-03 09:30:10 +02:00
import QtQuick 2.6
import QtQuick.Layouts 1.2
2017-12-20 14:54:05 +01:00
import Governikus.Global 1.0
2017-07-03 09:30:10 +02:00
Item {
id: baseItem
height: parent.height
width: mainContent.width
anchors.verticalCenter: parent.verticalCenter
property string category: ""
2017-07-03 09:33:28 +02:00
property alias imageSource: icon.source
property alias text: label.text
2017-07-03 09:30:10 +02:00
Row {
id: mainContent
height: parent.height
spacing: Utils.dp(5)
anchors.verticalCenter: parent.verticalCenter
Image {
id: icon
height: baseItem.height * 0.7
width: height
2017-07-03 09:33:28 +02:00
fillMode: Image.PreserveAspectFit
2017-07-03 09:30:10 +02:00
anchors.verticalCenter: parent.verticalCenter
}
Text {
2017-07-03 09:33:28 +02:00
id: label
2018-03-28 15:10:51 +02:00
color: Constants.secondary_text
2017-07-03 09:33:28 +02:00
font.pixelSize: Constants.normal_font_size
2017-07-03 09:30:10 +02:00
anchors.verticalCenter: parent.verticalCenter
}
2017-07-03 09:33:28 +02:00
GCheckBox {
id: checkbox
2017-07-03 09:30:10 +02:00
anchors.verticalCenter: parent.verticalCenter
visible: true
2017-07-03 09:33:28 +02:00
checked: providerModel.categories.indexOf(baseItem.category) !== -1
2017-07-03 09:30:10 +02:00
}
}
MouseArea {
anchors.fill: parent
2017-07-03 09:33:28 +02:00
onClicked: providerModel.updateCategorySelection(category, !checkbox.checked)
2017-07-03 09:30:10 +02:00
}
}