mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-04 03:06:57 +00:00
Align battery keep awake naming and slider
This commit is contained in:
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "Entladerate: {rate} W.",
|
||||
"health": "Zustand: {percent}%",
|
||||
"inhibit-idle-description": "Hält das System wach.",
|
||||
"inhibit-idle-label": "Ruhezustand verhindern",
|
||||
"inhibit-idle-label": "Wach halten",
|
||||
"idle": "Leerlauf.",
|
||||
"no-battery-detected": "Keine Batterie erkannt.",
|
||||
"panel-title": "Akku",
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "Discharging rate: {rate} W",
|
||||
"health": "Health: {percent}%",
|
||||
"inhibit-idle-description": "Keeps the system awake.",
|
||||
"inhibit-idle-label": "Prevent sleep",
|
||||
"inhibit-idle-label": "Keep awake",
|
||||
"idle": "Idle",
|
||||
"no-battery-detected": "No battery detected",
|
||||
"panel-title": "Battery",
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "Tasa de descarga: {rate} W.",
|
||||
"health": "Salud: {percent}%",
|
||||
"inhibit-idle-description": "Mantiene el sistema despierto.",
|
||||
"inhibit-idle-label": "Evitar suspensión",
|
||||
"inhibit-idle-label": "Mantener despierto",
|
||||
"idle": "Inactivo.",
|
||||
"no-battery-detected": "No se detectó ninguna batería.",
|
||||
"panel-title": "Batería",
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "Taux de décharge : {rate} W.",
|
||||
"health": "État : {percent}%",
|
||||
"inhibit-idle-description": "Maintient le système éveillé.",
|
||||
"inhibit-idle-label": "Empêcher la veille",
|
||||
"inhibit-idle-label": "Garder éveillé",
|
||||
"idle": "Inactif.",
|
||||
"no-battery-detected": "Aucune batterie détectée.",
|
||||
"panel-title": "Batterie",
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "Ontlaadsnelheid: {rate} W.",
|
||||
"health": "Gezondheid: {percent}%",
|
||||
"inhibit-idle-description": "Houdt het systeem wakker.",
|
||||
"inhibit-idle-label": "Slaapstand voorkomen",
|
||||
"inhibit-idle-label": "Wakker houden",
|
||||
"idle": "In rust.",
|
||||
"no-battery-detected": "Geen batterij gedetecteerd.",
|
||||
"panel-title": "Batterij",
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "Taxa de descarregamento: {rate} W.",
|
||||
"health": "Saúde: {percent}%",
|
||||
"inhibit-idle-description": "Mantém o sistema acordado.",
|
||||
"inhibit-idle-label": "Impedir suspensão",
|
||||
"inhibit-idle-label": "Manter acordado",
|
||||
"idle": "Ocioso.",
|
||||
"no-battery-detected": "Nenhuma bateria detectada.",
|
||||
"panel-title": "Bateria",
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "Скорость разрядки: {rate} Вт.",
|
||||
"health": "Здоровье: {percent}%",
|
||||
"inhibit-idle-description": "Не дает системе уснуть.",
|
||||
"inhibit-idle-label": "Запрет сна",
|
||||
"inhibit-idle-label": "Не давать засыпать",
|
||||
"idle": "Простой.",
|
||||
"no-battery-detected": "Батарея не обнаружена.",
|
||||
"panel-title": "Батарея",
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "Deşarj oranı: {rate} W.",
|
||||
"health": "Sağlık: {percent}%",
|
||||
"inhibit-idle-description": "Sistemi uyanık tutar.",
|
||||
"inhibit-idle-label": "Uykuya engelle",
|
||||
"inhibit-idle-label": "Uyanık tut",
|
||||
"idle": "Boşta.",
|
||||
"no-battery-detected": "Pil tespit edilmedi.",
|
||||
"panel-title": "Pil",
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "Швидкість розрядки: {rate} Вт.",
|
||||
"health": "Здоров'я: {percent}%",
|
||||
"inhibit-idle-description": "Підтримує систему активною.",
|
||||
"inhibit-idle-label": "Запобігати сну",
|
||||
"inhibit-idle-label": "Не давати заснути",
|
||||
"idle": "Бездіяльність.",
|
||||
"no-battery-detected": "Батарею не виявлено.",
|
||||
"panel-title": "Батарея",
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"discharging-rate": "放电速率:{rate} W。",
|
||||
"health": "健康状况:{percent}%",
|
||||
"inhibit-idle-description": "保持系统唤醒。",
|
||||
"inhibit-idle-label": "防止睡眠",
|
||||
"inhibit-idle-label": "保持唤醒",
|
||||
"idle": "空闲。",
|
||||
"no-battery-detected": "未检测到电池。",
|
||||
"panel-title": "电池",
|
||||
|
||||
@@ -22,6 +22,7 @@ SmartPanel {
|
||||
readonly property bool healthSupported: isReady && battery.healthSupported
|
||||
readonly property bool healthAvailable: healthSupported
|
||||
readonly property int healthPercent: healthAvailable ? Math.round(battery.healthPercentage) : -1
|
||||
readonly property var powerProfiles: [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance]
|
||||
readonly property string timeText: {
|
||||
if (!isReady)
|
||||
return I18n.tr("battery.no-battery-detected");
|
||||
@@ -202,26 +203,38 @@ SmartPanel {
|
||||
enabled: profilesAvailable
|
||||
onPressedChanged: function (pressed, v) {
|
||||
if (!pressed) {
|
||||
setProfileByIndex(Math.round(v));
|
||||
setProfileByIndex(v);
|
||||
}
|
||||
}
|
||||
onMoved: function (v) {
|
||||
profileIndex = Math.round(v);
|
||||
profileIndex = v;
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
checked: manualInhibitActive
|
||||
label: I18n.tr("battery.inhibit-idle-label")
|
||||
description: I18n.tr("battery.inhibit-idle-description")
|
||||
onToggled: function (checked) {
|
||||
if (checked) {
|
||||
IdleInhibitorService.addManualInhibitor(null);
|
||||
} else {
|
||||
IdleInhibitorService.removeManualInhibitor();
|
||||
spacing: Style.marginS
|
||||
|
||||
NIcon {
|
||||
icon: manualInhibitActive ? "keep-awake-on" : "keep-awake-off"
|
||||
pointSize: Style.fontSizeL
|
||||
color: manualInhibitActive ? Color.mPrimary : Color.mOnSurfaceVariant
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
checked: manualInhibitActive
|
||||
label: I18n.tr("battery.inhibit-idle-label")
|
||||
description: I18n.tr("battery.inhibit-idle-description")
|
||||
onToggled: function (checked) {
|
||||
if (checked) {
|
||||
IdleInhibitorService.addManualInhibitor(null);
|
||||
} else {
|
||||
IdleInhibitorService.removeManualInhibitor();
|
||||
}
|
||||
manualInhibitActive = checked;
|
||||
}
|
||||
manualInhibitActive = checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -230,27 +243,11 @@ SmartPanel {
|
||||
}
|
||||
|
||||
function profileToIndex(p) {
|
||||
switch (p) {
|
||||
case PowerProfile.PowerSaver:
|
||||
return 0;
|
||||
case PowerProfile.Balanced:
|
||||
return 1;
|
||||
case PowerProfile.Performance:
|
||||
return 2;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
return powerProfiles.indexOf(p) ?? 1;
|
||||
}
|
||||
|
||||
function indexToProfile(idx) {
|
||||
switch (idx) {
|
||||
case 0:
|
||||
return PowerProfile.PowerSaver;
|
||||
case 2:
|
||||
return PowerProfile.Performance;
|
||||
default:
|
||||
return PowerProfile.Balanced;
|
||||
}
|
||||
return powerProfiles[idx] ?? PowerProfile.Balanced;
|
||||
}
|
||||
|
||||
function setProfileByIndex(idx) {
|
||||
|
||||
Reference in New Issue
Block a user