Reusable Clock

This commit is contained in:
quadbyte 2025-08-10 00:09:45 -04:00
parent 1b69bab95f
commit 58c8cbbf1d
3 changed files with 39 additions and 24 deletions

View file

@ -73,7 +73,7 @@ PanelWindow {
Layout.alignment: Qt.AlignVCenter
}
NClock {}
Clock {}
NIconButton {
id: demoPanelToggler

32
Modules/Bar/Clock.qml Normal file
View file

@ -0,0 +1,32 @@
import QtQuick
import qs.Services
import qs.Widgets
// Clock Icon with attached calendar
NClock {
id: root
NTooltip {
id: tooltip
text: Time.dateString
target: root
}
NCalendar {
id: calendar
visible: false
}
onEntered: function (){
if (!calendar.visible) {
tooltip.show()
}
}
onExited: function (){
tooltip.hide()
}
onClicked: function () {
calendar.visible = !calendar.visible
tooltip.hide()
}
}