Files
z-bar-qt/Modules/Lock/Resources.qml
T
zach bda2c3821e
C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 16s
JS/TS / lint (pull_request) Successful in 18s
Python / fmt (pull_request) Successful in 33s
Python / lint (pull_request) Successful in 31s
Python / test (pull_request) Successful in 1m4s
Python / typecheck (pull_request) Failing after 1m14s
Rust / fmt (pull_request) Successful in 37s
Rust / build (pull_request) Successful in 1m47s
C++ / build (pull_request) Successful in 2m39s
Rust / clippy (pull_request) Successful in 1m10s
Python / buildcheck (pull_request) Successful in 2m27s
C++ / clang-tidy (pull_request) Successful in 3m55s
fix resources colors
2026-08-13 21:43:28 +02:00

85 lines
1.4 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import M3Shapes
import ZShell.Services
import ZShell.Config
import qs.Components
import qs.Effects
import qs.Services
CustomRect {
id: root
readonly property real fontScale: {
const diff = width / 391 - 1; // 391 is the width at 1080 height screen
return 1 + Math.pow(Math.abs(diff), 0.8) * Math.sign(diff);
}
color: Colors.tPalette.m3surfaceContainer
implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
radius: Tokens.rounding.small
ServiceRef {
service: Cpu
}
ServiceRef {
service: Memory
}
ServiceRef {
service: Storage
}
RowLayout {
id: layout
anchors.fill: parent
anchors.margins: Tokens.padding.large
spacing: Tokens.spacing.large
Resource {
id: cpu
fgColor: Colors.palette.m3primary
icon: "memory"
value: Cpu.percentage
}
Resource {
fgColor: Colors.palette.m3tertiary
icon: "memory_alt"
value: Memory.percentage
}
Resource {
fgColor: Colors.palette.m3secondary
icon: "hard_disk"
value: Storage.percentage
}
}
component Resource: CircularProgress {
id: res
required property string icon
Layout.fillWidth: true
implicitSize: width
Behavior on clampedVal {
Anim {
}
}
MaterialIcon {
anchors.centerIn: parent
color: res.fgColor
font.pointSize: Tokens.font.size.extraLarge
text: res.icon
}
}
}