forked from Shinonome/dots-hyprland
sidebar calendar some anims
This commit is contained in:
@@ -9,6 +9,7 @@ Button {
|
|||||||
property string day
|
property string day
|
||||||
property int isToday
|
property int isToday
|
||||||
property bool bold
|
property bool bold
|
||||||
|
property bool interactable: true
|
||||||
|
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: false
|
||||||
Layout.fillHeight: false
|
Layout.fillHeight: false
|
||||||
@@ -18,12 +19,20 @@ Button {
|
|||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
color: (isToday == 1) ? (button.down ? Appearance.colors.colPrimaryActive :
|
color: (isToday == 1) ? ((interactable && button.down) ? Appearance.colors.colPrimaryActive :
|
||||||
button.hovered ? Appearance.colors.colPrimaryHover :
|
(interactable && button.hovered) ? Appearance.colors.colPrimaryHover :
|
||||||
Appearance.m3colors.m3primary) :
|
Appearance.m3colors.m3primary) :
|
||||||
button.down ? Appearance.colors.colLayer1Active :
|
(interactable && button.down) ? Appearance.colors.colLayer1Active :
|
||||||
button.hovered ? Appearance.colors.colLayer1Hover :
|
(interactable && button.hovered) ? Appearance.colors.colLayer1Hover :
|
||||||
Appearance.transparentize(Appearance.colors.colLayer1, 1)
|
Appearance.transparentize(Appearance.colors.colLayer1, 1)
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Appearance.animation.elementDecel.duration
|
||||||
|
easing.type: Appearance.animation.elementDecel.type
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: StyledText {
|
contentItem: StyledText {
|
||||||
@@ -34,6 +43,14 @@ Button {
|
|||||||
color: (isToday == 1) ? Appearance.m3colors.m3onPrimary :
|
color: (isToday == 1) ? Appearance.m3colors.m3onPrimary :
|
||||||
(isToday == 0) ? Appearance.colors.colOnLayer1 :
|
(isToday == 0) ? Appearance.colors.colOnLayer1 :
|
||||||
Appearance.m3colors.m3outline
|
Appearance.m3colors.m3outline
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Appearance.animation.elementDecel.duration
|
||||||
|
easing.type: Appearance.animation.elementDecel.type
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ Rectangle {
|
|||||||
day: modelData.day
|
day: modelData.day
|
||||||
isToday: modelData.today
|
isToday: modelData.today
|
||||||
bold: true
|
bold: true
|
||||||
|
interactable: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user