- hypr/apps.lua - hypr/autostart.lua - hypr/envs.lua - hypr/hyprland.lua - hypr/hyprsunset.conf - hypr/input.lua - hypr/looknfeel.lua - hypr/omasettings.lua - hypr/xdph.conf - omarchy/branding/about.txt - omarchy/branding/screensaver.txt - omarchy/extensions/omarchy-menu.jsonc - omarchy/hooks/battery-low.d/play-warning-sound.sample - omarchy/hooks/font-set.d/show-font-notification.sample - omarchy/hooks/post-boot.d/weather.sample - omarchy/hooks/post-update.d/install-voxtype.hook - omarchy/hooks/post-update.d/setup-agent.hook - omarchy/hooks/post-update.d/setup-fingerprint.hook - omarchy/hooks/post-update.d/show-update-notification.sample - omarchy/hooks/pre-refresh-pacman.d/add-custom-repo.sample - omarchy/hooks/theme-set.d/show-theme-notification.sample - omarchy/shell.json - omarchy/shell.toml - omarchy/theme.name - omarchy/themes/azure-glow/README.md - omarchy/themes/azure-glow/alacritty.toml - omarchy/themes/azure-glow/btop.theme - omarchy/themes/azure-glow/hyprland.conf - omarchy/themes/azure-glow/hyprlock.conf - omarchy/themes/azure-glow/icons.theme - … 269 more
72 lines
1.9 KiB
QML
72 lines
1.9 KiB
QML
import QtQuick
|
|
import qs.Commons
|
|
|
|
// One of the three component scores: label, number, meter, one-line note.
|
|
Column {
|
|
id: root
|
|
|
|
property string label: ""
|
|
property var value: null // 0-100 or null
|
|
property string note: ""
|
|
property color textColor: Color.popups.text
|
|
property color dimColor: Color.muted
|
|
|
|
// Set when the number alone would mislead — a 24-hour reliability score
|
|
// still reading 100 in the first minute of an outage, say. The value is
|
|
// true, the green is not.
|
|
property var toneOverride: null
|
|
|
|
readonly property color tone: {
|
|
if (toneOverride) return toneOverride
|
|
if (value === null || value === undefined) return dimColor
|
|
if (value >= 80) return "#9ece6a"
|
|
if (value >= 50) return "#e0af68"
|
|
return Color.urgent
|
|
}
|
|
|
|
spacing: Style.space(5)
|
|
|
|
Text {
|
|
textFormat: Text.PlainText
|
|
text: root.label
|
|
color: root.dimColor
|
|
font.family: Style.font.family
|
|
font.pixelSize: Style.font.caption
|
|
font.letterSpacing: 1
|
|
}
|
|
|
|
Text {
|
|
textFormat: Text.PlainText
|
|
text: root.value === null || root.value === undefined
|
|
? "--" : String(Math.round(root.value))
|
|
color: root.tone
|
|
font.family: Style.font.family
|
|
font.pixelSize: Style.fontPx(1.8)
|
|
font.weight: Font.Bold
|
|
}
|
|
|
|
Rectangle {
|
|
width: parent.width
|
|
height: Math.max(2, Style.space(3))
|
|
color: Qt.rgba(root.textColor.r, root.textColor.g, root.textColor.b, 0.12)
|
|
|
|
Rectangle {
|
|
height: parent.height
|
|
width: parent.width * (root.value === null || root.value === undefined
|
|
? 0 : Math.max(0, Math.min(1, root.value / 100)))
|
|
color: root.tone
|
|
Behavior on width { NumberAnimation { duration: 300; easing.type: Easing.OutCubic } }
|
|
}
|
|
}
|
|
|
|
Text {
|
|
textFormat: Text.PlainText
|
|
width: parent.width
|
|
text: root.note
|
|
color: root.dimColor
|
|
font.family: Style.font.family
|
|
font.pixelSize: Style.font.caption
|
|
elide: Text.ElideRight
|
|
}
|
|
}
|