mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
feat: add date + calendar, also tidy up pointers/tooltips
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user