Merge pull request #827 from notiant/patch-1

LockScreen: make 'hibernate' optional
This commit is contained in:
Lysec
2025-11-22 13:14:53 +01:00
committed by GitHub
14 changed files with 58 additions and 10 deletions
+4
View File
@@ -1510,6 +1510,10 @@
"description": "Den Bildschirm beim Suspendieren des Systems automatisch sperren.",
"label": "Sperren beim Ruhezustand"
},
"show-hibernate": {
"description": "Die Option 'Ruhezustand' in den Energieaktionen anzeigen.",
"label": "Ruhezustand anzeigen"
},
"title": "Sperrbildschirm"
},
"network": {
+4
View File
@@ -1510,6 +1510,10 @@
"description": "Automatically lock the screen when suspending the system.",
"label": "Lock on suspend"
},
"show-hibernate": {
"description": "Show the option 'hibernate' in the energy actions.",
"label": "Show hibernate"
},
"title": "Lock screen"
},
"network": {
+4
View File
@@ -1510,6 +1510,10 @@
"description": "Bloquear la pantalla automáticamente al suspender el sistema.",
"label": "Bloquear al suspender"
},
"show-hibernate": {
"description": "Mostrar la opción 'hibernar' en las acciones de energía.",
"label": "Mostrar hibernar"
},
"title": "Pantalla de bloqueo"
},
"network": {
+4
View File
@@ -1510,6 +1510,10 @@
"description": "Verrouiller automatiquement l'écran lors de la mise en veille du système.",
"label": "Verrouiller à la suspension"
},
"show-hibernate": {
"description": "Afficher loption 'hiberner' dans les actions d’énergie.",
"label": "Afficher lhibernation"
},
"title": "Écran de verrouillage"
},
"network": {
+4
View File
@@ -1510,6 +1510,10 @@
"description": "Vergrendel het scherm automatisch wanneer het systeem wordt onderbroken.",
"label": "Vergrendelen bij onderbreken"
},
"show-hibernate": {
"description": "De optie 'sluimerstand' tonen in de energieacties.",
"label": "Sluimerstand tonen"
},
"title": "Vergrendelscherm"
},
"network": {
+4
View File
@@ -1510,6 +1510,10 @@
"description": "Bloquear a tela automaticamente ao suspender o sistema.",
"label": "Bloquear ao suspender"
},
"show-hibernate": {
"description": "Mostrar a opção 'hibernar' nas ações de energia.",
"label": "Mostrar hibernar"
},
"title": "Tela de bloqueio"
},
"network": {
+4
View File
@@ -1510,6 +1510,10 @@
"description": "Автоматически блокировать экран при приостановке работы системы.",
"label": "Блокировать при приостановке"
},
"show-hibernate": {
"description": "Показывать опцию 'спящий режим' в действиях питания.",
"label": "Показывать спящий режим"
},
"title": "Экран блокировки"
},
"network": {
+4
View File
@@ -1510,6 +1510,10 @@
"description": "Sistemi askıya alırken otomatik olarak ekranı kilitler.",
"label": "Askıya alırken kilitle"
},
"show-hibernate": {
"description": "Güç işlemlerinde 'hazırda beklet' seçeneğini göster.",
"label": "Hazırda beklet seçeneğini göster"
},
"title": "Ekran Kilit"
},
"network": {
+4
View File
@@ -1510,6 +1510,10 @@
"description": "Автоматично блокувати екран при призупиненні системи.",
"label": "Блокувати при призупиненні"
},
"show-hibernate": {
"description": "Показувати опцію 'сплячий режим' у діях живлення.",
"label": "Показувати сплячий режим"
},
"title": "Екран блокування"
},
"network": {
+4
View File
@@ -1510,6 +1510,10 @@
"description": "系统挂起时自动锁定屏幕。",
"label": "挂起时锁定"
},
"show-hibernate": {
"description": "在电源操作中显示'休眠'选项。",
"label": "显示休眠"
},
"title": "锁屏"
},
"network": {
+1
View File
@@ -70,6 +70,7 @@
"animationDisabled": false,
"compactLockScreen": false,
"lockOnSuspend": true,
"showHibernateOnLockScreen": true,
"enableShadows": true,
"shadowDirection": "bottom_right",
"shadowOffsetX": 2,
+1
View File
@@ -215,6 +215,7 @@ Singleton {
property bool animationDisabled: false
property bool compactLockScreen: false
property bool lockOnSuspend: true
property bool showHibernateOnLockScreen: true
property bool enableShadows: true
property string shadowDirection: "bottom_right"
property int shadowOffsetX: 2
+9 -10
View File
@@ -343,15 +343,15 @@ Loader {
text: {
var lang = I18n.locale.name.split("_")[0];
var formats = {
"en": "dddd, MMMM d",
"de": "dddd, d. MMMM",
"es": "dddd, d 'de' MMMM",
"fr": "dddd d MMMM",
"es": "dddd, d 'de' MMMM",
"pt": "dddd, d 'de' MMMM",
"zh": "yyyy年M月d日 dddd",
"uk": "dddd, d MMMM",
"tr": "dddd, d MMMM"
"nl": "dddd d MMMM"
};
return I18n.locale.toString(Time.now, formats[lang] || "dddd, MMMM d");
return I18n.locale.toString(Time.now, formats[lang] || "dddd, d MMMM");
}
pointSize: Style.fontSizeXL
font.weight: Font.Medium
@@ -524,7 +524,7 @@ Loader {
}
Text {
id: hibernateText
text: I18n.tr("session-menu.hibernate")
text: Settings.data.general.showHibernateOnLockScreen ? I18n.tr("session-menu.hibernate") : ""
font.pointSize: buttonRowTextMeasurer.fontSize
font.weight: Font.Medium
}
@@ -550,7 +550,7 @@ Loader {
// Button row needs: margins + 5 buttons + 4 spacings + margins
// Plus ColumnLayout margins (14 on each side = 28 total)
// Add extra buffer to ensure password input has proper padding
property real minButtonRowWidth: buttonRowTextMeasurer.minButtonWidth > 0 ? (5 * buttonRowTextMeasurer.minButtonWidth) + 40 + (2 * Style.marginM) + 28 + (2 * Style.marginM) : 750
property real minButtonRowWidth: buttonRowTextMeasurer.minButtonWidth > 0 ? ((Settings.data.general.showHibernateOnLockScreen ? 5 : 4) * buttonRowTextMeasurer.minButtonWidth) + 40 + (2 * Style.marginM) + 28 + (2 * Style.marginM) : 750
width: Math.max(750, minButtonRowWidth)
ColumnLayout {
@@ -749,7 +749,7 @@ Loader {
}
}
// 3-day forecast
// Forecast
RowLayout {
visible: Settings.data.location.weatherEnabled && LocationService.data.weather !== null
Layout.preferredWidth: 260
@@ -757,7 +757,7 @@ Loader {
spacing: 4
Repeater {
model: 3
model: MediaService.currentPlayer && MediaService.canPlay ? 3 : 4
delegate: ColumnLayout {
Layout.fillWidth: true
spacing: 3
@@ -804,8 +804,6 @@ Loader {
Item {
Layout.fillWidth: true
visible: !(Settings.data.location.weatherEnabled && LocationService.data.weather !== null)
Layout.preferredWidth: visible ? 1 : 0
}
// Battery and Keyboard Layout (full mode only)
@@ -1183,6 +1181,7 @@ Loader {
}
Rectangle {
visible: Settings.data.general.showHibernateOnLockScreen
Layout.fillWidth: true
Layout.minimumWidth: buttonRowTextMeasurer.minButtonWidth
Layout.preferredHeight: Settings.data.general.compactLockScreen ? 36 : 48
@@ -22,6 +22,13 @@ ColumnLayout {
onToggled: checked => Settings.data.general.compactLockScreen = checked
}
NToggle {
label: I18n.tr("settings.lock-screen.show-hibernate.label")
description: I18n.tr("settings.lock-screen.show-hibernate.description")
checked: Settings.data.general.showHibernateOnLockScreen
onToggled: checked => Settings.data.general.showHibernateOnLockScreen = checked
}
NDivider {
Layout.fillWidth: true
Layout.topMargin: Style.marginL