barmodule: own hoverpanel internally, modules supply content as component

This commit is contained in:
Damocles 2026-04-25 14:07:26 +02:00
parent 26476dc930
commit 6fd36c812f
17 changed files with 367 additions and 453 deletions

View file

@ -8,6 +8,16 @@ M.BarModule {
id: root
spacing: S.Theme.moduleSpacing
tooltip: Qt.formatDateTime(clock.date, "dddd, dd. MMMM yyyy")
panelNamespace: "nova-clock"
panelTitle: Qt.formatTime(clock.date, "HH:mm:ss")
panelContentWidth: 220
panelComponent: Component {
C.ClockApplet {
width: parent.width
accentColor: root.accentColor
currentDate: clock.date
}
}
SystemClock {
id: clock
@ -20,22 +30,4 @@ M.BarModule {
minText: "Wed, 00. Sep 00:00"
anchors.verticalCenter: parent.verticalCenter
}
M.HoverPanel {
id: hoverPanel
showPanel: root._showPanel
screen: QsWindow.window?.screen ?? null
anchorItem: root
accentColor: root.accentColor
panelNamespace: "nova-clock"
panelTitle: Qt.formatTime(clock.date, "HH:mm:ss")
contentWidth: 220
onDismissed: root.dismissPanel()
C.ClockApplet {
width: hoverPanel.contentWidth
accentColor: root.accentColor
currentDate: clock.date
}
}
}