Sysmon: no more width allocation

This commit is contained in:
Lemmy
2025-12-25 20:05:52 -05:00
parent 1626230efc
commit bfdc0724be
17 changed files with 199 additions and 104 deletions
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Festplattenspeicher-Nutzungsinformationen anzeigen.",
"label": "Speichernutzung"
},
"use-monospace-font": {
"description": "Verwende eine Monospace-Schriftart für eine konsistente Zeichenbreite.",
"label": "Schriftart mit fester Breite"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "Keine Übereinstimmung gefunden.",
"no-wallpaper": "Kein Hintergrundbild gefunden.",
"panel": {
"apikey": {
"help": "Ein API-Schlüssel ist erforderlich, um auf NSFW-Inhalte zuzugreifen.",
"label": "API-Schlüssel",
"placeholder": "Gib deinen Wallhaven API-Schlüssel ein"
},
"apply-all-monitors": {
"description": "Ausgewähltes Hintergrundbild auf alle Monitore gleichzeitig anwenden.",
"label": "Auf alle Monitore anwenden"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Alle",
"label": "Inhaltsfilter",
"nsfw": "Nicht jugendfrei",
"sfw": "SFW",
"sketchy": "Sketchy"
},
+11 -7
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Show disk space usage information.",
"label": "Storage usage"
},
"use-monospace-font": {
"description": "Use monospace font for consistent character width.",
"label": "Monospace font"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "No match found.",
"no-wallpaper": "No wallpaper found.",
"panel": {
"apikey": {
"help": "An API key is required to access NSFW content.",
"label": "API Key",
"placeholder": "Enter your Wallhaven API Key"
},
"apply-all-monitors": {
"description": "Apply the selected wallpaper to all monitors.",
"label": "Apply to all monitors"
@@ -2798,14 +2807,9 @@
"purity": {
"all": "All",
"label": "Content filter",
"nsfw": "NSFW",
"sfw": "SFW",
"sketchy": "Sketchy",
"nsfw": "NSFW"
},
"apikey": {
"label": "API Key",
"placeholder": "Enter your Wallhaven API Key",
"help": "An API key is required to access NSFW content."
"sketchy": "Sketchy"
},
"ratios": {
"any": "Any",
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Mostrar información del uso del espacio en disco.",
"label": "Uso de almacenamiento"
},
"use-monospace-font": {
"description": "```\nUtilice fuente monoespaciada para un ancho de carácter consistente.\n```",
"label": "Fuente monoespaciada"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "No se encontraron coincidencias.",
"no-wallpaper": "No se encontraron fondos de pantalla.",
"panel": {
"apikey": {
"help": "Se requiere una clave API para acceder a contenido NSFW.",
"label": "Clave API",
"placeholder": "Introduce tu clave API de Wallhaven"
},
"apply-all-monitors": {
"description": "Aplica el fondo de pantalla seleccionado a todos los monitores a la vez.",
"label": "Aplicar a todos los monitores"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Todo",
"label": "Filtro de contenido",
"nsfw": "NSFW",
"sfw": "SFW",
"sketchy": "Sketchy"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Afficher les informations d'utilisation de l'espace disque.",
"label": "Utilisation du stockage"
},
"use-monospace-font": {
"description": "```\nUtilisez une police de caractères à chasse fixe pour une largeur de caractère uniforme.\n```",
"label": "Police à chasse fixe"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "Aucun résultat trouvé.",
"no-wallpaper": "Aucun fond d'écran trouvé.",
"panel": {
"apikey": {
"help": "Une clé API est requise pour accéder au contenu NSFW.",
"label": "Clé API",
"placeholder": "Entrez votre clé API Wallhaven"
},
"apply-all-monitors": {
"description": "Appliquer le fond d'écran sélectionné à tous les moniteurs en même temps.",
"label": "Appliquer à tous les moniteurs"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Tout",
"label": "Filtre de contenu",
"nsfw": "NSFW se traduit généralement par :\n\n* **NSFW** (l'acronyme lui-même est souvent utilisé)\n* **Contenu explicite**\n* **Contenu réservé aux adultes**\n* **Déconseillé au travail** (plus littéral)",
"sfw": "SFW",
"sketchy": "Sketchy"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Lemezterület-használati információk megjelenítése.",
"label": "Tárhelyhasználat"
},
"use-monospace-font": {
"description": "```\nHasználj monospace betűtípust az egységes karakter-szélességhez.\n```",
"label": "Monospace betűtípus"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "Nincs találat.",
"no-wallpaper": "Nincs háttérkép találat.",
"panel": {
"apikey": {
"help": "NSFW tartalom eléréséhez API kulcs szükséges.",
"label": "API kulcs",
"placeholder": "Add meg a Wallhaven API kulcsodat!"
},
"apply-all-monitors": {
"description": "A kiválasztott háttérkép alkalmazása minden monitorra.",
"label": "Alkalmazás minden monitorra"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Mind",
"label": "Tartalomszűrő",
"nsfw": "Tilos a kiskorúaknak / Nem biztonságos munkahelyen",
"sfw": "SFW",
"sketchy": "Vázlatos"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "ストレージの使用状況を表示します。",
"label": "ストレージ使用量"
},
"use-monospace-font": {
"description": "```\nタイプライター体で翻訳します。\n\n```",
"label": "等幅フォント"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "一致する項目がありません。",
"no-wallpaper": "壁紙が見つかりません。",
"panel": {
"apikey": {
"help": "成人向けコンテンツにアクセスするには、APIキーが必要です。",
"label": "APIキー",
"placeholder": "Wallhaven APIキーを入力してください。"
},
"apply-all-monitors": {
"description": "選択した壁紙をすべてのディスプレイに適用します。",
"label": "全ディスプレイに適用"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "すべて",
"label": "コンテンツフィルタ",
"nsfw": "R-18",
"sfw": "SFW(全年齢)",
"sketchy": "Sketchy(際どい)"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Toon informatie over schijfruimtegebruik.",
"label": "Opslaggebruik"
},
"use-monospace-font": {
"description": "Gebruik een monospace lettertype voor een consistente tekenbreedte.",
"label": "Lettertype met vaste breedte"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "Geen resultaten gevonden.",
"no-wallpaper": "Geen achtergrond gevonden.",
"panel": {
"apikey": {
"help": "Een API-sleutel is vereist om toegang te krijgen tot NSFW-content.",
"label": "API-sleutel",
"placeholder": "Voer uw Wallhaven API-sleutel in"
},
"apply-all-monitors": {
"description": "Pas de geselecteerde achtergrond in één keer op alle monitoren toe.",
"label": "Toepassen op alle monitoren"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Alles",
"label": "Inhoudsfilter",
"nsfw": "Niet geschikt voor werk",
"sfw": "SFW",
"sketchy": "Sketchy"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Pokaż informacje o użyciu miejsca na dysku.",
"label": "Użycie dysku"
},
"use-monospace-font": {
"description": "Użyj czcionki o stałej szerokości znaków dla zachowania spójnej szerokości znaków.",
"label": "Czcionka o stałej szerokości znaków"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "Nie znaleziono dopasowania.",
"no-wallpaper": "Nie znaleziono tapety.",
"panel": {
"apikey": {
"help": "Do dostępu do treści NSFW wymagany jest klucz API.",
"label": "Klucz API",
"placeholder": "Wprowadź swój klucz API Wallhaven."
},
"apply-all-monitors": {
"description": "Zastosuj wybraną tapetę na wszystkich monitorach.",
"label": "Zastosuj na wszystkich monitorach"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Wszystkie",
"label": "Filtr treści",
"nsfw": "Niebezpieczne dla pracy.",
"sfw": "Bezpieczne (SFW)",
"sketchy": "Podejrzane (Sketchy)"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Mostrar informações de uso do espaço em disco.",
"label": "Uso de armazenamento"
},
"use-monospace-font": {
"description": "```\nUse fonte monoespaçada para largura de caractere consistente.\n```",
"label": "Fonte monoespaçada"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "Nenhuma correspondência encontrada.",
"no-wallpaper": "Nenhum papel de parede encontrado.",
"panel": {
"apikey": {
"help": "É necessária uma chave de API para acessar conteúdo NSFW.",
"label": "Chave de API",
"placeholder": "Insira sua chave da API Wallhaven"
},
"apply-all-monitors": {
"description": "Aplica o papel de parede selecionado a todos os monitores de uma só vez.",
"label": "Aplicar a todos os monitores"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Tudo",
"label": "Filtro de conteúdo",
"nsfw": "NSFW: Conteúdo adulto/impróprio para menores/NSFW",
"sfw": "SFW",
"sketchy": "Sketchy"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Показывать информацию об использовании дискового пространства.",
"label": "Использование хранилища"
},
"use-monospace-font": {
"description": "```\nИспользуйте моноширинный шрифт для единообразной ширины символов.\n```",
"label": "Моноширинный шрифт"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "Совпадений не найдено.",
"no-wallpaper": "Обои не найдены.",
"panel": {
"apikey": {
"help": "Для доступа к контенту NSFW требуется ключ API.",
"label": "Ключ API",
"placeholder": "Введите свой API-ключ Wallhaven"
},
"apply-all-monitors": {
"description": "Применить выбранные обои ко всем мониторам одновременно.",
"label": "Применить ко всем мониторам"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Все",
"label": "Фильтр контента",
"nsfw": "NSFW -> Не для работы (НСР) / Контент 18+",
"sfw": "SFW",
"sketchy": "Sketchy"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Disk alanı kullanım bilgilerini göster.",
"label": "Depolama kullanımı"
},
"use-monospace-font": {
"description": "```\nTekdüze karakter genişliği için tek aralıklı yazı tipini kullanın.\n```",
"label": "Tek aralıklı yazı tipi"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "Eşleşme bulunamadı.",
"no-wallpaper": "Duvar kâğıdı bulunamadı.",
"panel": {
"apikey": {
"help": "NSFW içeriğe erişmek için bir API anahtarı gereklidir.",
"label": "API Anahtarı",
"placeholder": "Wallhaven API Anahtarınızı girin"
},
"apply-all-monitors": {
"description": "Seçilen duvar kâğıdını tüm monitörlere aynı anda uygulayın.",
"label": "Tüm monitörler için uygula"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Tümü",
"label": "İçerik filtresi",
"nsfw": "Müstehcen",
"sfw": "SFW",
"sketchy": "Sketchy"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "Показувати інформацію про використання дискового простору.",
"label": "Використання сховища"
},
"use-monospace-font": {
"description": "Використовуйте моноширинний шрифт для забезпечення сталої ширини символів.",
"label": "Моноширинний шрифт"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "Збігів не знайдено.",
"no-wallpaper": "Шпалери не знайдено.",
"panel": {
"apikey": {
"help": "Для доступу до контенту NSFW потрібен ключ API.",
"label": "Ключ API",
"placeholder": "Введіть свій API-ключ Wallhaven"
},
"apply-all-monitors": {
"description": "Застосувати вибрані шпалери до всіх моніторів одночасно.",
"label": "Застосувати до всіх моніторів"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "Всі",
"label": "Фільтр контенту",
"nsfw": "NSFW → Не для перегляду на роботі / 18+ / Контент для дорослих",
"sfw": "SFW",
"sketchy": "Сумнівний"
},
+10
View File
@@ -334,6 +334,10 @@
"storage-usage": {
"description": "显示磁盘空间使用信息。",
"label": "存储使用率"
},
"use-monospace-font": {
"description": "请使用等宽字体以保持字符宽度一致。",
"label": "等宽字体"
}
},
"taskbar": {
@@ -2780,6 +2784,11 @@
"no-match": "未找到匹配项。",
"no-wallpaper": "未找到壁纸。",
"panel": {
"apikey": {
"help": "访问 NSFW 内容需要 API 密钥。",
"label": "API 密钥",
"placeholder": "输入您的Wallhaven API密钥"
},
"apply-all-monitors": {
"description": "一次性将选定的壁纸应用到所有显示器。",
"label": "应用到所有显示器"
@@ -2798,6 +2807,7 @@
"purity": {
"all": "全部",
"label": "内容过滤器",
"nsfw": "少儿不宜",
"sfw": "SFW",
"sketchy": "Sketchy"
},
+44 -62
View File
@@ -36,6 +36,7 @@ Rectangle {
readonly property bool density: Settings.data.bar.density
readonly property bool usePrimaryColor: widgetSettings.usePrimaryColor !== undefined ? widgetSettings.usePrimaryColor : widgetMetadata.usePrimaryColor
readonly property bool useMonospaceFont: widgetSettings.useMonospaceFont !== undefined ? widgetSettings.useMonospaceFont : widgetMetadata.useMonospaceFont
readonly property bool showCpuUsage: (widgetSettings.showCpuUsage !== undefined) ? widgetSettings.showCpuUsage : widgetMetadata.showCpuUsage
readonly property bool showCpuTemp: (widgetSettings.showCpuTemp !== undefined) ? widgetSettings.showCpuTemp : widgetMetadata.showCpuTemp
readonly property bool showGpuTemp: (widgetSettings.showGpuTemp !== undefined) ? widgetSettings.showGpuTemp : widgetMetadata.showGpuTemp
@@ -45,6 +46,7 @@ Rectangle {
readonly property bool showDiskUsage: (widgetSettings.showDiskUsage !== undefined) ? widgetSettings.showDiskUsage : widgetMetadata.showDiskUsage
readonly property string diskPath: (widgetSettings.diskPath !== undefined) ? widgetSettings.diskPath : widgetMetadata.diskPath
readonly property string fontFamily: useMonospaceFont ? Settings.data.ui.fontFixed : Settings.data.ui.fontDefault
readonly property real iconSize: textSize * 1.4
readonly property real textSize: {
var base = isVertical ? width * 0.82 : height;
@@ -59,9 +61,6 @@ Rectangle {
readonly property color warningColor: Settings.data.systemMonitor.useCustomColors ? (Settings.data.systemMonitor.warningColor || Color.mTertiary) : Color.mTertiary
readonly property color criticalColor: Settings.data.systemMonitor.useCustomColors ? (Settings.data.systemMonitor.criticalColor || Color.mError) : Color.mError
readonly property int percentTextWidth: Math.ceil(percentMetrics.boundingRect.width + 3)
readonly property int tempTextWidth: Math.ceil(tempMetrics.boundingRect.width + 3)
readonly property int memTextWidth: Math.ceil(memMetrics.boundingRect.width + 3)
readonly property color textColor: usePrimaryColor ? Color.mPrimary : Color.mOnSurface
// Threshold settings from global configuration
@@ -88,30 +87,6 @@ Rectangle {
readonly property bool diskWarning: showDiskUsage && SystemStatService.diskPercents[diskPath] > diskWarningThreshold
readonly property bool diskCritical: showDiskUsage && SystemStatService.diskPercents[diskPath] > diskCriticalThreshold
TextMetrics {
id: percentMetrics
font.family: Settings.data.ui.fontFixed
font.weight: Style.fontWeightMedium
font.pointSize: textSize * Settings.data.ui.fontFixedScale
text: "99%" // Use the longest possible string for measurement
}
TextMetrics {
id: tempMetrics
font.family: Settings.data.ui.fontFixed
font.weight: Style.fontWeightMedium
font.pointSize: textSize * Settings.data.ui.fontFixedScale
text: "99°" // Use the longest possible string for measurement
}
TextMetrics {
id: memMetrics
font.family: Settings.data.ui.fontFixed
font.weight: Style.fontWeightMedium
font.pointSize: textSize * Settings.data.ui.fontFixedScale
text: "12.3G" // Representative of formatted memory/network values (smart formatting keeps most values to 5 chars or less)
}
anchors.centerIn: parent
implicitWidth: isVertical ? Style.capsuleHeight : Math.round(mainGrid.implicitWidth + Style.marginM * 2)
implicitHeight: isVertical ? Math.round(mainGrid.implicitHeight + Style.marginM * 2) : Style.capsuleHeight
@@ -214,7 +189,9 @@ Rectangle {
// CPU Usage Component
Item {
id: cpuUsageContainer
Layout.preferredWidth: isVertical ? root.width : iconSize + percentTextWidth + (Style.marginXXS)
implicitWidth: cpuUsageContent.implicitWidth
implicitHeight: cpuUsageContent.implicitHeight
Layout.preferredWidth: isVertical ? root.width : implicitWidth
Layout.preferredHeight: Style.capsuleHeight
Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter
visible: showCpuUsage
@@ -240,7 +217,7 @@ Rectangle {
rows: isVertical ? 2 : 1
columns: isVertical ? 1 : 2
rowSpacing: Style.marginXXS
columnSpacing: Style.marginXXS
columnSpacing: Style.marginXS
Item {
Layout.alignment: Qt.AlignCenter
@@ -269,13 +246,12 @@ Rectangle {
return usage;
}
}
family: Settings.data.ui.fontFixed
family: fontFamily
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : percentTextWidth
horizontalAlignment: isVertical ? Text.AlignHCenter : Text.AlignRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
// Use highlight colors in vertical bar; otherwise invert text color to bar background when indicator active
color: isVertical ? (cpuCritical ? criticalColor : (cpuWarning ? warningColor : textColor)) : ((cpuWarning || cpuCritical) ? Color.mSurfaceVariant : textColor)
@@ -289,7 +265,9 @@ Rectangle {
// CPU Temperature Component
Item {
id: cpuTempContainer
Layout.preferredWidth: isVertical ? root.width : (iconSize + tempTextWidth) + (Style.marginXXS)
implicitWidth: cpuTempContent.implicitWidth
implicitHeight: cpuTempContent.implicitHeight
Layout.preferredWidth: isVertical ? root.width : implicitWidth
Layout.preferredHeight: Style.capsuleHeight
Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter
visible: showCpuTemp
@@ -315,7 +293,7 @@ Rectangle {
rows: isVertical ? 2 : 1
columns: isVertical ? 1 : 2
rowSpacing: Style.marginXXS
columnSpacing: Style.marginXXS
columnSpacing: Style.marginXS
Item {
Layout.alignment: Qt.AlignCenter
@@ -337,13 +315,12 @@ Rectangle {
NText {
text: `${Math.round(SystemStatService.cpuTemp)}°`
family: Settings.data.ui.fontFixed
family: fontFamily
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : tempTextWidth
horizontalAlignment: isVertical ? Text.AlignHCenter : Text.AlignRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
// Use highlight colors in vertical bar; otherwise invert text color to bar background when temp indicator active
color: isVertical ? (tempCritical ? criticalColor : (tempWarning ? warningColor : textColor)) : ((tempWarning || tempCritical) ? Color.mSurfaceVariant : textColor)
@@ -357,7 +334,9 @@ Rectangle {
// GPU Temperature Component
Item {
id: gpuTempContainer
Layout.preferredWidth: isVertical ? root.width : (iconSize + tempTextWidth) + (Style.marginXXS)
implicitWidth: gpuTempContent.implicitWidth
implicitHeight: gpuTempContent.implicitHeight
Layout.preferredWidth: isVertical ? root.width : implicitWidth
Layout.preferredHeight: Style.capsuleHeight
Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter
visible: showGpuTemp && SystemStatService.gpuAvailable
@@ -383,7 +362,7 @@ Rectangle {
rows: isVertical ? 2 : 1
columns: isVertical ? 1 : 2
rowSpacing: Style.marginXXS
columnSpacing: Style.marginXXS
columnSpacing: Style.marginXS
Item {
Layout.alignment: Qt.AlignCenter
@@ -405,13 +384,12 @@ Rectangle {
NText {
text: `${Math.round(SystemStatService.gpuTemp)}°`
family: Settings.data.ui.fontFixed
family: fontFamily
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : tempTextWidth
horizontalAlignment: isVertical ? Text.AlignHCenter : Text.AlignRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
// Use highlight colors in vertical bar; otherwise invert text color to bar background when GPU temp indicator active
color: isVertical ? (gpuCritical ? criticalColor : (gpuWarning ? warningColor : textColor)) : ((gpuWarning || gpuCritical) ? Color.mSurfaceVariant : textColor)
@@ -425,7 +403,9 @@ Rectangle {
// Memory Usage Component
Item {
id: memoryContainer
Layout.preferredWidth: isVertical ? root.width : iconSize + (showMemoryAsPercent ? percentTextWidth : memTextWidth) + (Style.marginXXS)
implicitWidth: memoryContent.implicitWidth
implicitHeight: memoryContent.implicitHeight
Layout.preferredWidth: isVertical ? root.width : implicitWidth
Layout.preferredHeight: Style.capsuleHeight
Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter
visible: showMemoryUsage
@@ -451,7 +431,7 @@ Rectangle {
rows: isVertical ? 2 : 1
columns: isVertical ? 1 : 2
rowSpacing: Style.marginXXS
columnSpacing: Style.marginXXS
columnSpacing: Style.marginXS
Item {
Layout.alignment: Qt.AlignCenter
@@ -473,13 +453,12 @@ Rectangle {
NText {
text: showMemoryAsPercent ? `${Math.round(SystemStatService.memPercent)}%` : SystemStatService.formatMemoryGb(SystemStatService.memGb)
family: Settings.data.ui.fontFixed
family: fontFamily
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : (showMemoryAsPercent ? percentTextWidth : memTextWidth)
horizontalAlignment: isVertical ? Text.AlignHCenter : Text.AlignRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
// Use highlight colors in vertical bar; otherwise invert text color to bar background when memory indicator active
color: isVertical ? (memCritical ? criticalColor : (memWarning ? warningColor : textColor)) : ((memWarning || memCritical) ? Color.mSurfaceVariant : textColor)
@@ -492,7 +471,9 @@ Rectangle {
// Network Download Speed Component
Item {
Layout.preferredWidth: isVertical ? root.width : iconSize + memTextWidth + (Style.marginXXS)
implicitWidth: downloadContent.implicitWidth
implicitHeight: downloadContent.implicitHeight
Layout.preferredWidth: isVertical ? root.width : implicitWidth
Layout.preferredHeight: Style.capsuleHeight
Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter
visible: showNetworkStats
@@ -504,7 +485,7 @@ Rectangle {
rows: isVertical ? 2 : 1
columns: isVertical ? 1 : 2
rowSpacing: Style.marginXXS
columnSpacing: Style.marginXXS
columnSpacing: Style.marginXS
Item {
Layout.alignment: Qt.AlignCenter
@@ -524,13 +505,12 @@ Rectangle {
NText {
text: isVertical ? SystemStatService.formatCompactSpeed(SystemStatService.rxSpeed) : SystemStatService.formatSpeed(SystemStatService.rxSpeed)
family: Settings.data.ui.fontFixed
family: fontFamily
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : memTextWidth
horizontalAlignment: isVertical ? Text.AlignHCenter : Text.AlignRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: textColor
Layout.row: isVertical ? 0 : 0
@@ -542,7 +522,9 @@ Rectangle {
// Network Upload Speed Component
Item {
Layout.preferredWidth: isVertical ? root.width : iconSize + memTextWidth + (Style.marginXXS)
implicitWidth: uploadContent.implicitWidth
implicitHeight: uploadContent.implicitHeight
Layout.preferredWidth: isVertical ? root.width : implicitWidth
Layout.preferredHeight: Style.capsuleHeight
Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter
visible: showNetworkStats
@@ -554,7 +536,7 @@ Rectangle {
rows: isVertical ? 2 : 1
columns: isVertical ? 1 : 2
rowSpacing: Style.marginXXS
columnSpacing: Style.marginXXS
columnSpacing: Style.marginXS
Item {
Layout.alignment: Qt.AlignCenter
@@ -574,13 +556,12 @@ Rectangle {
NText {
text: isVertical ? SystemStatService.formatCompactSpeed(SystemStatService.txSpeed) : SystemStatService.formatSpeed(SystemStatService.txSpeed)
family: Settings.data.ui.fontFixed
family: fontFamily
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : memTextWidth
horizontalAlignment: isVertical ? Text.AlignHCenter : Text.AlignRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: textColor
Layout.row: isVertical ? 0 : 0
@@ -593,7 +574,9 @@ Rectangle {
// Disk Usage Component (primary drive)
Item {
id: diskContainer
Layout.preferredWidth: isVertical ? root.width : iconSize + percentTextWidth + (Style.marginXXS)
implicitWidth: diskContent.implicitWidth
implicitHeight: diskContent.implicitHeight
Layout.preferredWidth: isVertical ? root.width : implicitWidth
Layout.preferredHeight: Style.capsuleHeight
Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter
visible: showDiskUsage
@@ -619,7 +602,7 @@ Rectangle {
rows: isVertical ? 2 : 1
columns: isVertical ? 1 : 2
rowSpacing: Style.marginXXS
columnSpacing: Style.marginXXS
columnSpacing: Style.marginXS
Item {
Layout.alignment: Qt.AlignCenter
@@ -642,13 +625,12 @@ Rectangle {
NText {
id: toto
text: SystemStatService.diskPercents[diskPath] ? `${SystemStatService.diskPercents[diskPath]}%` : "n/a"
family: Settings.data.ui.fontFixed
family: fontFamily
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : percentTextWidth
horizontalAlignment: isVertical ? Text.AlignHCenter : Text.AlignRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
// Use highlight colors in vertical bar; otherwise invert text color to bar background when disk indicator active
color: isVertical ? (diskCritical ? criticalColor : (diskWarning ? warningColor : textColor)) : ((diskWarning || diskCritical) ? Color.mSurfaceVariant : textColor)
@@ -15,6 +15,7 @@ ColumnLayout {
// Local, editable state for checkboxes
property bool valueUsePrimaryColor: widgetData.usePrimaryColor !== undefined ? widgetData.usePrimaryColor : widgetMetadata.usePrimaryColor
property bool valueUseMonospaceFont: widgetData.useMonospaceFont !== undefined ? widgetData.useMonospaceFont : widgetMetadata.useMonospaceFont
property bool valueShowCpuUsage: widgetData.showCpuUsage !== undefined ? widgetData.showCpuUsage : widgetMetadata.showCpuUsage
property bool valueShowCpuTemp: widgetData.showCpuTemp !== undefined ? widgetData.showCpuTemp : widgetMetadata.showCpuTemp
property bool valueShowGpuTemp: widgetData.showGpuTemp !== undefined ? widgetData.showGpuTemp : widgetMetadata.showGpuTemp
@@ -27,6 +28,7 @@ ColumnLayout {
function saveSettings() {
var settings = Object.assign({}, widgetData || {});
settings.usePrimaryColor = valueUsePrimaryColor;
settings.useMonospaceFont = valueUseMonospaceFont;
settings.showCpuUsage = valueShowCpuUsage;
settings.showCpuTemp = valueShowCpuTemp;
settings.showGpuTemp = valueShowGpuTemp;
@@ -47,6 +49,14 @@ ColumnLayout {
onToggled: checked => valueUsePrimaryColor = checked
}
NToggle {
Layout.fillWidth: true
label: I18n.tr("bar.widget-settings.system-monitor.use-monospace-font.label")
description: I18n.tr("bar.widget-settings.system-monitor.use-monospace-font.description")
checked: valueUseMonospaceFont
onToggled: checked => valueUseMonospaceFont = checked
}
NToggle {
id: showCpuUsage
Layout.fillWidth: true
+13 -35
View File
@@ -652,42 +652,20 @@ Singleton {
// -------------------------------------------------------
// Helper function to format network speeds
function formatSpeed(bytesPerSecond) {
if (bytesPerSecond < 1024 * 1024) {
const kb = bytesPerSecond / 1024;
if (kb < 10) {
let formatted = kb.toFixed(1) + "KB";
if (formatted.length > 5) {
formatted = kb.toFixed(1) + "K";
}
return formatted;
} else {
let formatted = Math.round(kb) + "KB";
if (formatted.length > 5) {
formatted = Math.round(kb) + "K";
}
return formatted;
}
} else if (bytesPerSecond < 1024 * 1024 * 1024) {
const mb = bytesPerSecond / (1024 * 1024);
let formatted = mb.toFixed(1) + "MB";
if (formatted.length > 5) {
formatted = mb.toFixed(1) + "M";
if (formatted.length > 5) {
formatted = Math.round(mb) + "M";
}
}
return formatted;
} else {
const gb = bytesPerSecond / (1024 * 1024 * 1024);
let formatted = gb.toFixed(1) + "GB";
if (formatted.length > 5) {
formatted = gb.toFixed(1) + "G";
if (formatted.length > 5) {
formatted = Math.round(gb) + "G";
}
}
return formatted;
const units = ["KB", "MB", "GB"];
let value = bytesPerSecond / 1024;
let unitIndex = 0;
while (value >= 1024 && unitIndex < units.length - 1) {
value /= 1024;
unitIndex++;
}
const unit = units[unitIndex];
const shortUnit = unit[0];
const numStr = value < 10 ? value.toFixed(1) : Math.round(value).toString();
return (numStr + unit).length > 5 ? numStr + shortUnit : numStr + unit;
}
// -------------------------------------------------------
+1
View File
@@ -193,6 +193,7 @@ Singleton {
"SystemMonitor": {
"allowUserSettings": true,
"usePrimaryColor": false,
"useMonospaceFont": true,
"showCpuUsage": true,
"showCpuTemp": true,
"showGpuTemp": false,