From f5d47335e82aa3fabcd691103e22a3d10736ed35 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 16 Apr 2025 10:44:15 +0200 Subject: [PATCH] sidebar calendar some anims --- .../sidebarRight/CalendarDayButton.qml | 25 ++++++++++++++++--- .../modules/sidebarRight/SidebarCalendar.qml | 3 ++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.config/quickshell/modules/sidebarRight/CalendarDayButton.qml b/.config/quickshell/modules/sidebarRight/CalendarDayButton.qml index 0ec588d02..da4f5c8f5 100644 --- a/.config/quickshell/modules/sidebarRight/CalendarDayButton.qml +++ b/.config/quickshell/modules/sidebarRight/CalendarDayButton.qml @@ -9,6 +9,7 @@ Button { property string day property int isToday property bool bold + property bool interactable: true Layout.fillWidth: false Layout.fillHeight: false @@ -18,12 +19,20 @@ Button { background: Rectangle { anchors.fill: parent radius: Appearance.rounding.full - color: (isToday == 1) ? (button.down ? Appearance.colors.colPrimaryActive : - button.hovered ? Appearance.colors.colPrimaryHover : + color: (isToday == 1) ? ((interactable && button.down) ? Appearance.colors.colPrimaryActive : + (interactable && button.hovered) ? Appearance.colors.colPrimaryHover : Appearance.m3colors.m3primary) : - button.down ? Appearance.colors.colLayer1Active : - button.hovered ? Appearance.colors.colLayer1Hover : + (interactable && button.down) ? Appearance.colors.colLayer1Active : + (interactable && button.hovered) ? Appearance.colors.colLayer1Hover : Appearance.transparentize(Appearance.colors.colLayer1, 1) + + Behavior on color { + ColorAnimation { + duration: Appearance.animation.elementDecel.duration + easing.type: Appearance.animation.elementDecel.type + } + + } } contentItem: StyledText { @@ -34,6 +43,14 @@ Button { color: (isToday == 1) ? Appearance.m3colors.m3onPrimary : (isToday == 0) ? Appearance.colors.colOnLayer1 : Appearance.m3colors.m3outline + + Behavior on color { + ColorAnimation { + duration: Appearance.animation.elementDecel.duration + easing.type: Appearance.animation.elementDecel.type + } + + } } } diff --git a/.config/quickshell/modules/sidebarRight/SidebarCalendar.qml b/.config/quickshell/modules/sidebarRight/SidebarCalendar.qml index c70b9a7c6..b85a5ca31 100644 --- a/.config/quickshell/modules/sidebarRight/SidebarCalendar.qml +++ b/.config/quickshell/modules/sidebarRight/SidebarCalendar.qml @@ -28,7 +28,7 @@ Rectangle { Layout.leftMargin: 15 spacing: 15 Repeater { - model: [ + model: [ {"name": "Calendar", "icon": "calendar_month"}, {"name": "To Do", "icon": "done_outline"} ] @@ -65,6 +65,7 @@ Rectangle { day: modelData.day isToday: modelData.today bold: true + interactable: false } } }