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
This commit is contained in:
Huỳnh Thiện Lộc authored and GitHub committed 2026-09-04 10:28:37 -04:00
1 parent ec22e9e594
commit 07d8e28668
1 file changed
+18 -1
@@ -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()
}