From 07d8e286682eacbd2a19f59663a11a9cb4b4f8a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=E1=BB=B3nh=20Thi=E1=BB=87n=20L=E1=BB=99c?= Date: Fri, 4 Sep 2026 21:28:37 +0700 Subject: [PATCH] fix(dash): dim today button when on current month (#3294) * fix(dash): dim today button when on current month and hide tooltip on click * fix(dash): use Theme.shortDuration for calendar today button opacity animation * refactor(dash): use standard DankActionButton tooltipText for calendar today button * chore(dash): remove unused todayButton id * fix(dash): allow returning to today when another day in current month is selected --- .../Overview/CalendarOverviewCard.qml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/quickshell/Modules/DankDash/Overview/CalendarOverviewCard.qml b/quickshell/Modules/DankDash/Overview/CalendarOverviewCard.qml index 31370c196..91de958f9 100644 --- a/quickshell/Modules/DankDash/Overview/CalendarOverviewCard.qml +++ b/quickshell/Modules/DankDash/Overview/CalendarOverviewCard.qml @@ -349,10 +349,27 @@ Rectangle { } DankActionButton { + readonly property bool isToday: { + const now = systemClock.date; + const disp = calendarGrid.displayDate; + const sel = calendarGrid.selectedDate; + return disp.getFullYear() === now.getFullYear() && disp.getMonth() === now.getMonth() && sel.getFullYear() === now.getFullYear() && sel.getMonth() === now.getMonth() && sel.getDate() === now.getDate(); + } + buttonSize: 28 iconSize: 14 iconName: "today" - iconColor: Theme.primary + iconColor: enabled ? Theme.primary : Theme.surfaceTextMedium + enabled: !isToday + opacity: enabled ? 1 : 0.38 + tooltipText: I18n.tr("Today") + + Behavior on opacity { + NumberAnimation { + duration: Theme.shortDuration + } + } + onClicked: root.goToToday() }