Add and delete works now!

This commit is contained in:
2022-04-01 16:08:02 -07:00
parent 58b32a6cb3
commit a5ef038823
2 changed files with 106 additions and 26 deletions

View File

@@ -37,23 +37,53 @@ Kirigami.ApplicationWindow {
contentItem: Item {
implicitWidth: delegateLayout.implicitWidth
implicitHeight: delegateLayout.implicitHeight
RowLayout {
id: delegateLayout
anchors {
left: parent.left
top: parent.top
right: parent.right
}
Kirigami.Heading {
text: flightCategory
}
Controls.Label {
text: rawMetar
ColumnLayout {
id: delegateLayout
anchors {
left: parent.left
top: parent.top
right: parent.right
}
RowLayout {
Layout.fillWidth: true
Kirigami.Heading {
text: stationId
}
Kirigami.Heading {
text: flightCategory
// Dynamically set the color based on the flight category
Component.onCompleted: {
color = Qt.binding(function() {
if (flightCategory == "VFR") {
return "green";
} else if (flightCategory == "MVFR") {
return "blue";
} else if (flightCategory == "IFR") {
return "red";
} else if (flightCategory == "LIFR") {
return "fuchsia";
} else {
return "white";
}
});
}
}
Controls.Button {
Layout.alignment: Qt.AlignRight
icon.name: "edit-delete"
onClicked: logic.deleteAirport(stationId)
}
}
Controls.Label {
text: rawMetar
Layout.fillWidth: true
wrapMode: Text.WordWrap
}
}
}
}
}
}
Kirigami.OverlaySheet {
id: addAirport