1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-09 06:55:37 -05:00

Fix event animation

This commit is contained in:
bbedward
2025-07-14 13:54:06 -04:00
parent fff7dace3b
commit 58d711b3e9
2 changed files with 21 additions and 7 deletions

View File

@@ -76,9 +76,10 @@ PanelWindow {
contentHeight += mainRowHeight + theme.spacingM // Add spacing between main row and events contentHeight += mainRowHeight + theme.spacingM // Add spacing between main row and events
// Add events widget height - dynamically calculated // Add events widget height - use calculated height instead of actual
if (CalendarService && CalendarService.khalAvailable) { if (CalendarService && CalendarService.khalAvailable) {
let eventsHeight = eventsWidget.height || 120 // Use actual widget height or fallback let hasEvents = eventsWidget.selectedDateEvents && eventsWidget.selectedDateEvents.length > 0
let eventsHeight = hasEvents ? Math.min(300, 80 + eventsWidget.selectedDateEvents.length * 60) : 120
contentHeight += eventsHeight contentHeight += eventsHeight
} }
@@ -136,6 +137,15 @@ PanelWindow {
} }
} }
// Update height when events widget's selectedDateEvents changes
Connections {
target: eventsWidget
enabled: eventsWidget !== null
function onSelectedDateEventsChanged() {
mainContainer.height = mainContainer.calculateHeight()
}
}
Behavior on opacity { Behavior on opacity {
NumberAnimation { NumberAnimation {
duration: theme.longDuration duration: theme.longDuration
@@ -216,10 +226,6 @@ PanelWindow {
theme: centerCommandCenter.theme theme: centerCommandCenter.theme
selectedDate: calendarWidget.selectedDate selectedDate: calendarWidget.selectedDate
// Update container height when events widget height changes
onHeightChanged: {
mainContainer.height = mainContainer.calculateHeight()
}
} }
} }
} }

View File

@@ -136,7 +136,8 @@ Rectangle {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: theme.spacingL anchors.margins: theme.spacingL
anchors.topMargin: theme.spacingM anchors.topMargin: theme.spacingM
visible: hasEvents visible: opacity > 0
opacity: hasEvents ? 1.0 : 0.0
clip: true clip: true
spacing: theme.spacingS spacing: theme.spacingS
boundsMovement: Flickable.StopAtBounds boundsMovement: Flickable.StopAtBounds
@@ -146,6 +147,13 @@ Rectangle {
policy: eventsList.contentHeight > eventsList.height ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff policy: eventsList.contentHeight > eventsList.height ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff
} }
Behavior on opacity {
NumberAnimation {
duration: theme.mediumDuration
easing.type: theme.emphasizedEasing
}
}
delegate: Rectangle { delegate: Rectangle {
width: eventsList.width width: eventsList.width
height: eventContent.implicitHeight + theme.spacingM height: eventContent.implicitHeight + theme.spacingM