feat: add date + calendar, also tidy up pointers/tooltips

This commit is contained in:
ferreo
2025-07-18 18:53:42 +01:00
parent bc1f4a385e
commit 435ecf8d4b
19 changed files with 595 additions and 208 deletions
+30
View File
@@ -1,7 +1,11 @@
import QtQuick
import qs.Settings
import qs.Components
Rectangle {
id: clockWidget
property var screen: (typeof modelData !== 'undefined' ? modelData : null)
property var showTooltip: false
width: textItem.paintedWidth
height: textItem.paintedHeight
color: "transparent"
@@ -15,4 +19,30 @@ Rectangle {
color: Theme.textPrimary
anchors.centerIn: parent
}
MouseArea {
id: clockMouseArea
anchors.fill: parent
hoverEnabled: true
onEntered: showTooltip = true
onExited: showTooltip = false
cursorShape: Qt.PointingHandCursor
onClicked: function() {
calendar.visible = !calendar.visible
}
}
Calendar {
id: calendar
screen: clockWidget.screen
visible: false
}
StyledTooltip {
id: dateTooltip
text: Time.dateString
tooltipVisible: showTooltip && !calendar.visible
targetItem: clockWidget
delay: 200
}
}