diff options
| author | Nippy <nippy@rp1.hu> | 2026-05-09 13:33:09 +0200 |
|---|---|---|
| committer | Nippy <nippy@rp1.hu> | 2026-05-09 13:33:09 +0200 |
| commit | a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5 (patch) | |
| tree | 1a8769217f84bfe9d6216fafaadaf8cdd876d457 /raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/DankBar/Widgets/CpuMonitor.qml | |
| parent | 34b9c34f982b2596cfa9e368a2d7f74e9a17477c (diff) | |
| download | RaveOS-PKGBUILD-a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5.tar.gz RaveOS-PKGBUILD-a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5.zip | |
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/DankBar/Widgets/CpuMonitor.qml')
| -rw-r--r-- | raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/DankBar/Widgets/CpuMonitor.qml | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/DankBar/Widgets/CpuMonitor.qml b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/DankBar/Widgets/CpuMonitor.qml deleted file mode 100644 index 212f9b5..0000000 --- a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/DankBar/Widgets/CpuMonitor.qml +++ /dev/null @@ -1,146 +0,0 @@ -import QtQuick -import qs.Common -import qs.Modules.Plugins -import qs.Services -import qs.Widgets - -BasePill { - id: root - - property bool showPercentage: true - property bool showIcon: true - property var toggleProcessList - property var popoutTarget: null - property var widgetData: null - property bool minimumWidth: (widgetData && widgetData.minimumWidth !== undefined) ? widgetData.minimumWidth : true - - signal cpuClicked - - Component.onCompleted: { - DgopService.addRef(["cpu"]); - } - Component.onDestruction: { - DgopService.removeRef(["cpu"]); - } - - content: Component { - Item { - implicitWidth: root.isVerticalOrientation ? (root.widgetThickness - root.horizontalPadding * 2) : cpuContent.implicitWidth - implicitHeight: root.isVerticalOrientation ? cpuColumn.implicitHeight : cpuContent.implicitHeight - - Column { - id: cpuColumn - visible: root.isVerticalOrientation - anchors.centerIn: parent - spacing: 1 - - DankIcon { - name: "memory" - size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale) - color: { - if (DgopService.cpuUsage > 80) { - return Theme.tempDanger; - } - - if (DgopService.cpuUsage > 60) { - return Theme.tempWarning; - } - - return Theme.widgetIconColor; - } - anchors.horizontalCenter: parent.horizontalCenter - } - - StyledText { - text: { - if (DgopService.cpuUsage === undefined || DgopService.cpuUsage === null || DgopService.cpuUsage === 0) { - return "--"; - } - - return DgopService.cpuUsage.toFixed(0); - } - font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) - color: Theme.widgetTextColor - anchors.horizontalCenter: parent.horizontalCenter - } - } - - Row { - id: cpuContent - visible: !root.isVerticalOrientation - anchors.centerIn: parent - spacing: Theme.spacingXS - - DankIcon { - id: cpuIcon - name: "memory" - size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale) - color: { - if (DgopService.cpuUsage > 80) { - return Theme.tempDanger; - } - - if (DgopService.cpuUsage > 60) { - return Theme.tempWarning; - } - - return Theme.widgetIconColor; - } - anchors.verticalCenter: parent.verticalCenter - } - - Item { - id: textBox - anchors.verticalCenter: parent.verticalCenter - - implicitWidth: root.minimumWidth ? Math.max(cpuBaseline.width, cpuCurrent.width) : cpuCurrent.width - implicitHeight: cpuText.implicitHeight - - width: implicitWidth - height: implicitHeight - - StyledTextMetrics { - id: cpuBaseline - font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) - text: "100%" - } - - StyledTextMetrics { - id: cpuCurrent - font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) - text: cpuText.text - } - - StyledText { - id: cpuText - text: { - const v = DgopService.cpuUsage; - if (v === undefined || v === null || v === 0) { - return "--%"; - } - return v.toFixed(0) + "%"; - } - font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) - color: Theme.widgetTextColor - - anchors.fill: parent - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideNone - } - } - } - } - } - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - acceptedButtons: Qt.LeftButton - onPressed: mouse => { - root.triggerRipple(this, mouse.x, mouse.y); - DgopService.setSortBy("cpu"); - cpuClicked(); - } - } -} |