Fixed Layout to automatically recenter

This commit is contained in:
Diyou 2024-03-19 17:47:39 +01:00
parent 94d85dbcc4
commit 7137c24b20
No known key found for this signature in database
GPG key ID: 74219FC76F60F354

View file

@ -45,6 +45,8 @@ PlasmoidItem {
} }
fullRepresentation: ColumnLayout { fullRepresentation: ColumnLayout {
width: childrenRect.width + 20
height: childrenRect.height + 20
anchors.fill: parent anchors.fill: parent
spacing: -20 spacing: -20
@ -68,7 +70,7 @@ PlasmoidItem {
Item { Item {
width: Math.max(textMetricsClockLabel.width, textMetricsDayLabel.width) width: Math.max(textMetricsClockLabel.width, textMetricsDayLabel.width)
height: Math.max(textMetricsClockLabel.height, textMetricsDayLabel.height) height: Math.max(textMetricsClockLabel.height, textMetricsDayLabel.height)
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignHCenter
Text { Text {
id: clockLabel id: clockLabel
@ -129,7 +131,7 @@ PlasmoidItem {
Text { Text {
id: dateLabel id: dateLabel
visible: plasmoid.configuration.showDateDisplay visible: plasmoid.configuration.showDateDisplay
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignHCenter
text: Qt.formatDate(currentDateTime, plasmoid.configuration.dateCustomDateFormat) text: Qt.formatDate(currentDateTime, plasmoid.configuration.dateCustomDateFormat)