formatter
This commit is contained in:
@@ -13,48 +13,49 @@ GridLayout {
|
||||
required property var locale
|
||||
required property Item wrapper
|
||||
|
||||
columnSpacing: 4
|
||||
columns: 7
|
||||
rowSpacing: 4
|
||||
columnSpacing: 4
|
||||
uniformCellWidths: true
|
||||
uniformCellHeights: true
|
||||
|
||||
component Anim: NumberAnimation {
|
||||
target: root
|
||||
duration: MaterialEasing.expressiveEffectsTime
|
||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||
}
|
||||
uniformCellWidths: true
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
|
||||
model: ScriptModel {
|
||||
values: Calendar.getWeeksForMonth(Calendar.displayMonth, Calendar.displayYear)
|
||||
|
||||
Behavior on values {
|
||||
SequentialAnimation {
|
||||
id: switchAnim
|
||||
|
||||
ParallelAnimation {
|
||||
Anim {
|
||||
property: "opacity"
|
||||
from: 1.0
|
||||
property: "opacity"
|
||||
to: 0.0
|
||||
}
|
||||
|
||||
Anim {
|
||||
property: "scale"
|
||||
from: 1.0
|
||||
property: "scale"
|
||||
to: 0.8
|
||||
}
|
||||
}
|
||||
PropertyAction {}
|
||||
|
||||
PropertyAction {
|
||||
}
|
||||
|
||||
ParallelAnimation {
|
||||
Anim {
|
||||
property: "opacity"
|
||||
from: 0.0
|
||||
property: "opacity"
|
||||
to: 1.0
|
||||
}
|
||||
|
||||
Anim {
|
||||
property: "scale"
|
||||
from: 0.8
|
||||
property: "scale"
|
||||
to: 1.0
|
||||
}
|
||||
}
|
||||
@@ -63,15 +64,11 @@ GridLayout {
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
||||
required property var modelData
|
||||
required property int index
|
||||
required property var modelData
|
||||
|
||||
Layout.preferredWidth: 40
|
||||
Layout.preferredHeight: width
|
||||
|
||||
|
||||
radius: 1000
|
||||
Layout.preferredWidth: 40
|
||||
color: {
|
||||
if (modelData.isToday) {
|
||||
console.log(width);
|
||||
@@ -79,39 +76,52 @@ GridLayout {
|
||||
}
|
||||
return "transparent";
|
||||
}
|
||||
radius: 1000
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation { duration: 200 }
|
||||
ColorAnimation {
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
|
||||
CustomText {
|
||||
anchors.centerIn: parent
|
||||
|
||||
text: parent.modelData.day.toString()
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
opacity: parent.modelData.isCurrentMonth ? 1.0 : 0.4
|
||||
color: {
|
||||
if (parent.modelData.isToday) {
|
||||
return DynamicColors.palette.m3onPrimaryContainer;
|
||||
}
|
||||
return DynamicColors.palette.m3onSurface;
|
||||
}
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
opacity: parent.modelData.isCurrentMonth ? 1.0 : 0.4
|
||||
text: parent.modelData.day.toString()
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation { duration: 200 }
|
||||
ColorAnimation {
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 200 }
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
|
||||
onClicked: {
|
||||
console.log(`Selected date: ${parent.modelData.day}/${parent.modelData.month + 1}/${parent.modelData.year}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component Anim: NumberAnimation {
|
||||
duration: MaterialEasing.expressiveEffectsTime
|
||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||
target: root
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user