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,22 @@ M.BarModule {
id: root
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
tooltip: "Temperature: " + _temp + "\u00B0C"
panelNamespace: "nova-temperature"
panelTitle: "Temperature"
panelContentWidth: 220
panelComponent: Component {
C.TemperatureApplet {
width: parent.width
temp: root._temp
warm: root._warm
hot: root._hot
history: S.SystemStats.tempHistory
devices: S.SystemStats.tempDevices
accentColor: root.accentColor
deviceFilter: root._deviceFilter
active: root._showPanel
}
}
readonly property int _warm: S.Modules.temperature.warm || 80
readonly property int _hot: S.Modules.temperature.hot || 90
@ -40,28 +56,4 @@ M.BarModule {
color: root._stateColor
anchors.verticalCenter: parent.verticalCenter
}
M.HoverPanel {
id: hoverPanel
showPanel: root._showPanel
screen: QsWindow.window?.screen ?? null
anchorItem: root
accentColor: root.accentColor
panelNamespace: "nova-temperature"
panelTitle: "Temperature"
contentWidth: 220
onDismissed: root.dismissPanel()
C.TemperatureApplet {
width: hoverPanel.contentWidth
temp: root._temp
warm: root._warm
hot: root._hot
history: S.SystemStats.tempHistory
devices: S.SystemStats.tempDevices
accentColor: root.accentColor
deviceFilter: root._deviceFilter
active: root._showPanel
}
}
}