Commit 4605859e authored by Dimitris Kardarakos's avatar Dimitris Kardarakos

On top of the calendar month grid, conditionally display month name and year

parent 4f7f2b50
......@@ -36,9 +36,8 @@ MonthView {
signal goToday
signal refresh
property int currentYear: plasmaCalendar.year
currentMonthName: plasmaCalendar.displayedDateMonthName
displayedYear: plasmaCalendar.year
displayedMonthName: plasmaCalendar.displayedDateMonthName
selectedDayTodosCount: todosCount(selectedDate)
selectedDayEventsCount: eventsCount(selectedDate)
daysModel: plasmaCalendar.daysModel
......
......@@ -132,7 +132,7 @@ Kirigami.ApplicationWindow {
Kirigami.Page {
title: calendarMonthView.currentMonthName + " " + calendarMonthView.currentYear
title: calendarMonthView.displayedMonthName + " " + calendarMonthView.displayedYear
actions {
left: Kirigami.Action {
......
......@@ -40,7 +40,9 @@ Item {
property date selectedDate: new Date()
property int selectedDayTodosCount: 0
property int selectedDayEventsCount: 0
property string currentMonthName
property string displayedMonthName
property int displayedYear
/**
* A model that provides:
*
......@@ -72,6 +74,7 @@ Item {
}
property bool showHeader: false
property bool showMonthName: true
property bool showYear: true
function reloadSelectedDate() {
root.selectedDayTodosCount = root.todosCount(root.selectedDate)
......@@ -101,10 +104,19 @@ Item {
}
Controls2.Label {
visible: showMonthName
font.pointSize: Kirigami.Units.fontMetrics.font.pointSize * 1.5
text: currentMonthName
RowLayout {
Controls2.Label {
visible: showMonthName
font.pointSize: Kirigami.Units.fontMetrics.font.pointSize * 1.5
text: displayedMonthName
}
Controls2.Label {
visible: showYear
font.pointSize: Kirigami.Units.fontMetrics.font.pointSize * 1.5
text: displayedYear
}
}
/**
......
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