forked from Shinonome/dots-hyprland
waffles: make calendar spacing more accurate
This commit is contained in:
@@ -87,7 +87,8 @@ Item {
|
|||||||
property real verticalPadding: 0
|
property real verticalPadding: 0
|
||||||
property real buttonSize: 40
|
property real buttonSize: 40
|
||||||
property real buttonSpacing: 2
|
property real buttonSpacing: 2
|
||||||
implicitHeight: (6 * buttonSize) + (5 * buttonSpacing) + (2 * verticalPadding)
|
property real buttonVerticalSpacing: buttonSpacing
|
||||||
|
implicitHeight: (6 * buttonSize) + (5 * buttonVerticalSpacing) + (2 * verticalPadding)
|
||||||
implicitWidth: weeksColumn.implicitWidth
|
implicitWidth: weeksColumn.implicitWidth
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
@@ -98,13 +99,13 @@ Item {
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
y: {
|
y: {
|
||||||
const spacePerExtraRow = root.buttonSize + root.buttonSpacing;
|
const spacePerExtraRow = root.buttonSize + root.buttonVerticalSpacing;
|
||||||
const origin = -(spacePerExtraRow * root.paddingWeeks);
|
const origin = -(spacePerExtraRow * root.paddingWeeks);
|
||||||
const diff = root.weekDiff * spacePerExtraRow;
|
const diff = root.weekDiff * spacePerExtraRow;
|
||||||
return origin + (-diff % spacePerExtraRow) + root.verticalPadding;
|
return origin + (-diff % spacePerExtraRow) + root.verticalPadding;
|
||||||
}
|
}
|
||||||
|
|
||||||
spacing: root.buttonSpacing
|
spacing: root.buttonVerticalSpacing
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: root.totalWeeks
|
model: root.totalWeeks
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ BodyRectangle {
|
|||||||
locale: root.locale
|
locale: root.locale
|
||||||
verticalPadding: 2
|
verticalPadding: 2
|
||||||
buttonSize: 41 // ???
|
buttonSize: 41 // ???
|
||||||
buttonSpacing: 1
|
buttonSpacing: 6
|
||||||
|
buttonVerticalSpacing: 1
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
delegate: DayButton {}
|
delegate: DayButton {}
|
||||||
}
|
}
|
||||||
@@ -90,7 +91,7 @@ BodyRectangle {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: dayButton.model.day
|
text: dayButton.model.day
|
||||||
color: dayButton.fgColor
|
color: dayButton.fgColor
|
||||||
font.pixelSize: Looks.font.pixelSize.large
|
font.pixelSize: Looks.font.pixelSize.larger
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user