refactor: unified BarModule base component, click-to-open panels, remove pinning
This commit is contained in:
parent
034f0b6d85
commit
26476dc930
33 changed files with 273 additions and 517 deletions
|
|
@ -4,10 +4,10 @@ import "." as M
|
|||
import "../services" as S
|
||||
import "../applets" as C
|
||||
|
||||
M.PinnableSection {
|
||||
M.BarModule {
|
||||
id: root
|
||||
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
|
||||
_panelHovered: hoverPanel.panelHovered
|
||||
tooltip: "CPU: " + S.SystemStats.cpuUsage + "% @ " + S.SystemStats.cpuFreqGhz.toFixed(2) + " GHz"
|
||||
|
||||
readonly property var _cores: S.SystemStats.cpuCores
|
||||
readonly property var _coreMaxFreq: S.SystemStats.cpuCoreMaxFreq
|
||||
|
|
@ -34,17 +34,11 @@ M.PinnableSection {
|
|||
M.BarIcon {
|
||||
icon: "\uF2DB"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
TapHandler {
|
||||
onTapped: root._pinned = !root._pinned
|
||||
}
|
||||
}
|
||||
M.BarLabel {
|
||||
label: S.SystemStats.cpuUsage.toString().padStart(2) + "%@" + S.SystemStats.cpuFreqGhz.toFixed(2)
|
||||
minText: "99%@9.99"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
TapHandler {
|
||||
onTapped: root._pinned = !root._pinned
|
||||
}
|
||||
}
|
||||
|
||||
M.HoverPanel {
|
||||
|
|
@ -56,6 +50,7 @@ M.PinnableSection {
|
|||
panelNamespace: "nova-cpu"
|
||||
panelTitle: "CPU"
|
||||
contentWidth: 260
|
||||
onDismissed: root.dismissPanel()
|
||||
|
||||
C.CpuApplet {
|
||||
width: hoverPanel.contentWidth
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue