mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #827 from notiant/patch-1
LockScreen: make 'hibernate' optional
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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 l’option 'hiberner' dans les actions d’énergie.",
|
||||
"label": "Afficher l’hibernation"
|
||||
},
|
||||
"title": "Écran de verrouillage"
|
||||
},
|
||||
"network": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -1510,6 +1510,10 @@
|
||||
"description": "Автоматически блокировать экран при приостановке работы системы.",
|
||||
"label": "Блокировать при приостановке"
|
||||
},
|
||||
"show-hibernate": {
|
||||
"description": "Показывать опцию 'спящий режим' в действиях питания.",
|
||||
"label": "Показывать спящий режим"
|
||||
},
|
||||
"title": "Экран блокировки"
|
||||
},
|
||||
"network": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -1510,6 +1510,10 @@
|
||||
"description": "Автоматично блокувати екран при призупиненні системи.",
|
||||
"label": "Блокувати при призупиненні"
|
||||
},
|
||||
"show-hibernate": {
|
||||
"description": "Показувати опцію 'сплячий режим' у діях живлення.",
|
||||
"label": "Показувати сплячий режим"
|
||||
},
|
||||
"title": "Екран блокування"
|
||||
},
|
||||
"network": {
|
||||
|
||||
@@ -1510,6 +1510,10 @@
|
||||
"description": "系统挂起时自动锁定屏幕。",
|
||||
"label": "挂起时锁定"
|
||||
},
|
||||
"show-hibernate": {
|
||||
"description": "在电源操作中显示'休眠'选项。",
|
||||
"label": "显示休眠"
|
||||
},
|
||||
"title": "锁屏"
|
||||
},
|
||||
"network": {
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
"animationDisabled": false,
|
||||
"compactLockScreen": false,
|
||||
"lockOnSuspend": true,
|
||||
"showHibernateOnLockScreen": true,
|
||||
"enableShadows": true,
|
||||
"shadowDirection": "bottom_right",
|
||||
"shadowOffsetX": 2,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -21,6 +21,13 @@ ColumnLayout {
|
||||
checked: Settings.data.general.compactLockScreen
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user