mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
feat: Add toggle for calendar event display
This commit is contained in:
@@ -626,6 +626,10 @@
|
||||
"week-numbers": {
|
||||
"label": "Show week numbers",
|
||||
"description": "Displays the week of the year (e.g., Week 38) in the calendar."
|
||||
},
|
||||
"show-events": {
|
||||
"label": "Show calendar events",
|
||||
"description": "Display events in the calendar panel."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -202,6 +202,7 @@ Singleton {
|
||||
property bool useFahrenheit: false
|
||||
property bool use12hourFormat: false
|
||||
property bool showWeekNumberInCalendar: false
|
||||
property bool showCalendarEvents: true
|
||||
}
|
||||
|
||||
// screen recorder
|
||||
|
||||
@@ -561,7 +561,7 @@ NPanel {
|
||||
|
||||
// Event indicator dots
|
||||
Row {
|
||||
visible: parent.parent.parent.parent.parent.hasEventsOnDate(model.year, model.month, model.day)
|
||||
visible: Settings.data.location.showCalendarEvents && parent.parent.parent.parent.parent.hasEventsOnDate(model.year, model.month, model.day)
|
||||
spacing: 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
@@ -587,6 +587,7 @@ NPanel {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: Settings.data.location.showCalendarEvents
|
||||
|
||||
onEntered: {
|
||||
const events = parent.parent.parent.parent.parent.getEventsForDate(model.year, model.month, model.day)
|
||||
|
||||
@@ -117,6 +117,13 @@ ColumnLayout {
|
||||
checked: Settings.data.location.showWeekNumberInCalendar
|
||||
onToggled: checked => Settings.data.location.showWeekNumberInCalendar = checked
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("settings.location.date-time.show-events.label")
|
||||
description: I18n.tr("settings.location.date-time.show-events.description")
|
||||
checked: Settings.data.location.showCalendarEvents
|
||||
onToggled: checked => Settings.data.location.showCalendarEvents = checked
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
|
||||
@@ -92,7 +92,11 @@ Singleton {
|
||||
|
||||
// Core functions
|
||||
function checkAvailability() {
|
||||
availabilityCheckProcess.running = true
|
||||
if (Settings.data.location.showCalendarEvents) {
|
||||
availabilityCheckProcess.running = true
|
||||
} else {
|
||||
root.available = false
|
||||
}
|
||||
}
|
||||
|
||||
function loadCalendars() {
|
||||
@@ -100,6 +104,11 @@ Singleton {
|
||||
}
|
||||
|
||||
function loadEvents(daysAhead = 31, daysBehind = 14) {
|
||||
if (!Settings.data.location.showCalendarEvents) {
|
||||
root.loading = false
|
||||
root.events = []
|
||||
return
|
||||
}
|
||||
if (loading)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user