This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
fanny-app/qml/Components/FoodPlanView.qml
dorian 2ff52410d2 - cleaned up the views
- added teacher mode
2018-12-27 21:41:46 +01:00

133 lines
2.6 KiB
QML

import Backend 1.0
import QtQuick 2.9
import QtQuick.Controls 2.4
FannyDataListView {
id: foodList
anchors.fill: parent
model: FoodPlanModel {
id: foodPlanModel
}
delegate: Button {
id: delegate
width: foodList.width
height: contentCol.height + 10
Column {
id: contentCol
anchors {
top: parent.top
left: parent.left
right: parent.right
margins: 10
}
height: childrenRect.height + 10
spacing: 2
Label {
id: cookteamLa
// label for the cookteam
width: parent.width
wrapMode: Label.Wrap
font.bold: true
text: cookteam
}
Label {
id: dateLa
// label for the date
width: parent.width
wrapMode: Label.Wrap
font.bold: true
text: date
}
Rectangle {
width: parent.width
height: 2
color: "grey"
}
Label {
id: mainDishLa
// label for the main dish
width: parent.width
wrapMode: Label.Wrap
text: mainDish
}
Rectangle {
width: parent.width / 10
height: mainDishVegLa.text!=""? 1:0
color: "grey"
}
Label {
id: mainDishVegLa
// label for the vegetarian main dish
width: parent.width
height: text!=""? undefined:0
wrapMode: Label.Wrap
text: mainDishVeg
}
Rectangle {
width: parent.width / 10
height: garnishLa.text!=""? 1:0
color: "grey"
}
Label {
id: garnishLa
// label for the garnish
width: parent.width
height: text!=""? undefined:0
wrapMode: Label.Wrap
text: garnish
}
Rectangle {
width: parent.width / 10
height: dessertLa.text!=""? 1:0
color: "grey"
}
Label {
id: dessertLa
// label for the dessert
width: parent.width
height: text!=""? undefined:0
wrapMode: Label.Wrap
text: dessert
}
}
}
}