mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 16:32:50 -05:00
calendar: parse event links from description
This commit is contained in:
@@ -287,6 +287,10 @@ DankPopout {
|
|||||||
OverviewTab {
|
OverviewTab {
|
||||||
id: overviewTab
|
id: overviewTab
|
||||||
|
|
||||||
|
onCloseDash: {
|
||||||
|
root.dashVisible = false
|
||||||
|
}
|
||||||
|
|
||||||
onSwitchToWeatherTab: {
|
onSwitchToWeatherTab: {
|
||||||
if (SettingsData.weatherEnabled) {
|
if (SettingsData.weatherEnabled) {
|
||||||
tabBar.currentIndex = 3
|
tabBar.currentIndex = 3
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ Rectangle {
|
|||||||
property var selectedDateEvents: []
|
property var selectedDateEvents: []
|
||||||
property bool hasEvents: selectedDateEvents && selectedDateEvents.length > 0
|
property bool hasEvents: selectedDateEvents && selectedDateEvents.length > 0
|
||||||
|
|
||||||
|
signal closeDash()
|
||||||
|
|
||||||
function weekStartJs() {
|
function weekStartJs() {
|
||||||
return Qt.locale().firstDayOfWeek % 7
|
return Qt.locale().firstDayOfWeek % 7
|
||||||
}
|
}
|
||||||
@@ -428,24 +430,12 @@ Rectangle {
|
|||||||
if (modelData.url && modelData.url !== "") {
|
if (modelData.url && modelData.url !== "") {
|
||||||
if (Qt.openUrlExternally(modelData.url) === false) {
|
if (Qt.openUrlExternally(modelData.url) === false) {
|
||||||
console.warn("Failed to open URL: " + modelData.url)
|
console.warn("Failed to open URL: " + modelData.url)
|
||||||
|
} else {
|
||||||
|
root.closeDash()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on border.color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ Item {
|
|||||||
|
|
||||||
signal switchToWeatherTab()
|
signal switchToWeatherTab()
|
||||||
signal switchToMediaTab()
|
signal switchToMediaTab()
|
||||||
|
signal closeDash()
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -58,6 +59,8 @@ Item {
|
|||||||
y: 100 + Theme.spacingM
|
y: 100 + Theme.spacingM
|
||||||
width: parent.width * 0.6
|
width: parent.width * 0.6
|
||||||
height: 300
|
height: 300
|
||||||
|
|
||||||
|
onCloseDash: root.closeDash()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Media - bottom right (narrow and taller)
|
// Media - bottom right (narrow and taller)
|
||||||
|
|||||||
@@ -223,6 +223,13 @@ Singleton {
|
|||||||
let eventId = event.title + "_" + event['start-date']
|
let eventId = event.title + "_" + event['start-date']
|
||||||
+ "_" + (event['start-time'] || 'allday')
|
+ "_" + (event['start-time'] || 'allday')
|
||||||
// Create event object template
|
// Create event object template
|
||||||
|
let extractedUrl = ""
|
||||||
|
if (!event.url && event.description) {
|
||||||
|
let urlMatch = event.description.match(/https?:\/\/[^\s]+/)
|
||||||
|
if (urlMatch) {
|
||||||
|
extractedUrl = urlMatch[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
let eventTemplate = {
|
let eventTemplate = {
|
||||||
"id": eventId,
|
"id": eventId,
|
||||||
"title": event.title || "Untitled Event",
|
"title": event.title || "Untitled Event",
|
||||||
@@ -230,7 +237,7 @@ Singleton {
|
|||||||
"end": endTime,
|
"end": endTime,
|
||||||
"location": event.location || "",
|
"location": event.location || "",
|
||||||
"description": event.description || "",
|
"description": event.description || "",
|
||||||
"url": event.url || "",
|
"url": event.url || extractedUrl,
|
||||||
"calendar": "",
|
"calendar": "",
|
||||||
"color": "",
|
"color": "",
|
||||||
"allDay": event['all-day'] === "True",
|
"allDay": event['all-day'] === "True",
|
||||||
|
|||||||
Reference in New Issue
Block a user