make buttons ripple

This commit is contained in:
end-4
2025-05-22 19:01:20 +02:00
parent 042a4d1c24
commit 927487c60f
26 changed files with 305 additions and 400 deletions
@@ -5,7 +5,7 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Button {
RippleButton {
id: button
property string day
property int isToday
@@ -17,20 +17,8 @@ Button {
implicitWidth: 38;
implicitHeight: 38;
background: Rectangle {
anchors.fill: parent
radius: Appearance.rounding.full
color: (isToday == 1) ? ((interactable && button.down) ? Appearance.colors.colPrimaryActive :
(interactable && button.hovered) ? Appearance.colors.colPrimaryHover :
Appearance.m3colors.m3primary) :
(interactable && button.down) ? Appearance.colors.colLayer1Active :
(interactable && button.hovered) ? Appearance.colors.colLayer1Hover :
ColorUtils.transparentize(Appearance.colors.colLayer1, 1)
Behavior on color {
animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this)
}
}
toggled: (isToday == 1)
buttonRadius: Appearance.rounding.small
contentItem: StyledText {
anchors.fill: parent