Commit 6c6b84fc authored by Dimitris Kardarakos's avatar Dimitris Kardarakos

Show a message when no tasks or events exist

When no task or event is scheduled for a specific date, the list view did not show anything. With this commit, a descriptive message is displayed, mentioning that there is no task/event scheduled for that day.
parent 3f478c25
Pipeline #6115 passed with stage
in 5 minutes and 31 seconds
......@@ -44,6 +44,12 @@ Kirigami.Page {
onTriggered: pageStack.push(eventEditor, {startdt: eventStartDt})
}
Component {
id: eventController
Calindori.EventController {}
}
Component {
id: eventEditor
......@@ -57,16 +63,22 @@ Kirigami.Page {
}
}
Controls2.Label {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
visible: eventsModel.count == 0
wrapMode: Text.WordWrap
text: eventStartDt.toLocaleDateString() != "" ? i18n("No events scheduled for %1", eventStartDt.toLocaleDateString(Qt.locale(), Locale.ShortFormat)) : i18n("No events scheduled")
font.pointSize: Kirigami.Units.fontMetrics.font.pointSize * 1.5
}
Kirigami.CardsListView {
id: cardsListview
anchors.fill: parent
model: Calindori.EventModel {
filterdt: root.eventStartDt
memorycalendar: root.calendar.memorycalendar
}
model: eventsModel
delegate: Kirigami.Card {
id: cardDelegate
......@@ -127,10 +139,11 @@ Kirigami.Page {
}
}
Component {
id: eventController
Calindori.EventModel {
id: eventsModel
Calindori.EventController {}
filterdt: root.eventStartDt
memorycalendar: root.calendar.memorycalendar
}
}
......@@ -56,14 +56,28 @@ Kirigami.Page {
}
}
Component {
id: todoController
Calindori.TodoController {}
}
Controls2.Label {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
visible: todosModel.count == 0
wrapMode: Text.WordWrap
text: todoDt.toLocaleDateString() != "" ? i18n("No tasks scheduled for %1", todoDt.toLocaleDateString(Qt.locale(), Locale.ShortFormat)) : i18n("No tasks scheduled")
font.pointSize: Kirigami.Units.fontMetrics.font.pointSize * 1.5
}
Kirigami.CardsListView {
id: cardsListview
anchors.fill: parent
model: Calindori.TodosModel {
filterdt: root.todoDt
memorycalendar: root.calendar.memorycalendar
}
model: todosModel
delegate: Kirigami.Card {
id: cardDelegate
......@@ -119,9 +133,10 @@ Kirigami.Page {
}
}
Component {
id: todoController
Calindori.TodosModel {
id: todosModel
Calindori.TodoController {}
filterdt: root.todoDt
memorycalendar: root.calendar.memorycalendar
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment