LockScreen: add compact mode toggle in GeneralTab

Settings: add lockscreen compact mode setting
i18n: add translations
This commit is contained in:
lysec
2025-10-12 11:04:35 +02:00
parent b4a344b0b5
commit d5d654e010
9 changed files with 114 additions and 19 deletions
+4
View File
@@ -26,6 +26,10 @@
"label": "Desktop abdunkeln",
"description": "Desktop abdunkeln, wenn Panels oder Menüs geöffnet sind."
},
"compact-lockscreen": {
"label": "Kompakter Sperrbildschirm",
"description": "Zeigt nur die Anmeldeeingabe und Systemsteuerungen an, versteckt Wetter- und Medien-Widgets."
},
"border-radius": {
"label": "Eckenradius",
"description": "Steuert die Rundung der Ecken von Fenstern, Buttons und anderen Elementen."
+4
View File
@@ -26,6 +26,10 @@
"label": "Dim desktop",
"description": "Dim the desktop when panels or menus are open."
},
"compact-lockscreen": {
"label": "Compact lock screen",
"description": "Show only the login input and system controls, hiding weather and media widgets."
},
"border-radius": {
"label": "Border radius",
"description": "Controls the corner roundness of windows, buttons, and other elements."
+4
View File
@@ -26,6 +26,10 @@
"label": "Atenuar escritorio",
"description": "Atenúa el escritorio cuando los paneles o menús están abiertos."
},
"compact-lockscreen": {
"label": "Pantalla de bloqueo compacta",
"description": "Muestra solo la entrada de inicio de sesión y controles del sistema, ocultando widgets de clima y medios."
},
"border-radius": {
"label": "Radio del borde",
"description": "Controla la redondez de las esquinas de ventanas, botones y otros elementos."
+4
View File
@@ -26,6 +26,10 @@
"label": "Assombrir le bureau",
"description": "Assombrir le bureau lorsque des panneaux ou des menus sont ouverts."
},
"compact-lockscreen": {
"label": "Écran de verrouillage compact",
"description": "Affiche uniquement la saisie de connexion et les contrôles système, masquant les widgets météo et média."
},
"border-radius": {
"label": "Rayon de bordure",
"description": "Contrôle l'arrondi des coins des fenêtres, des boutons et d'autres éléments."
+4
View File
@@ -26,6 +26,10 @@
"label": "Escurecer área de trabalho",
"description": "Escurece a área de trabalho quando painéis ou menus estão abertos."
},
"compact-lockscreen": {
"label": "Tela de bloqueio compacta",
"description": "Mostra apenas a entrada de login e controles do sistema, ocultando widgets de clima e mídia."
},
"border-radius": {
"label": "Raio da borda",
"description": "Controla o arredondamento dos cantos de janelas, botões e outros elementos."
+4
View File
@@ -26,6 +26,10 @@
"label": "调暗桌面",
"description": "当面板或菜单打开时调暗桌面。"
},
"compact-lockscreen": {
"label": "紧凑锁屏",
"description": "仅显示登录输入和系统控件,隐藏天气和媒体小部件。"
},
"border-radius": {
"label": "边框圆角",
"description": "控制窗口、按钮及其他元素的边角圆度。"
+1
View File
@@ -187,6 +187,7 @@ Singleton {
property real screenRadiusRatio: 1.0
property real animationSpeed: 1.0
property bool animationDisabled: false
property bool compactLockScreen: false
}
// location
+82 -19
View File
@@ -253,7 +253,7 @@ Loader {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 100 * scaling
radius: 32 * scaling
radius: Style.radiusL * scaling
color: Color.mSurface
border.color: Qt.alpha(Color.mOutline, 0.2)
border.width: 1
@@ -317,11 +317,6 @@ Loader {
}
}
// Spacer to center the text section
Item {
Layout.fillWidth: true
}
// Center: User Info Column (left-aligned text)
ColumnLayout {
Layout.alignment: Qt.AlignVCenter
@@ -346,12 +341,12 @@ Loader {
}
}
// Spacer to push cool time to the right
// Spacer to push time to the right
Item {
Layout.fillWidth: true
}
// Right side: Cool Time (from Calendar)
Item {
Layout.preferredWidth: 70 * scaling
Layout.preferredHeight: 70 * scaling
@@ -469,17 +464,82 @@ Loader {
}
}
// Compact status indicators container (compact mode only)
Rectangle {
width: {
var hasBattery = UPower.displayDevice && UPower.displayDevice.ready && UPower.displayDevice.isPresent
var hasKeyboard = keyboardLayout.currentLayout !== "Unknown"
if (hasBattery && hasKeyboard) {
return 200 * scaling
} else if (hasBattery || hasKeyboard) {
return 120 * scaling
} else {
return 0
}
}
height: 40 * scaling
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 96 * scaling + (Settings.data.general.compactLockScreen ? 116 * scaling : 220 * scaling)
topLeftRadius: Style.radiusL * scaling
topRightRadius: Style.radiusL * scaling
color: Color.mSurface
visible: Settings.data.general.compactLockScreen && ((UPower.displayDevice && UPower.displayDevice.ready && UPower.displayDevice.isPresent) || keyboardLayout.currentLayout !== "Unknown")
RowLayout {
anchors.centerIn: parent
spacing: 16 * scaling
// Battery indicator
RowLayout {
spacing: 6 * scaling
visible: UPower.displayDevice && UPower.displayDevice.ready && UPower.displayDevice.isPresent
NIcon {
icon: BatteryService.getIcon(Math.round(UPower.displayDevice.percentage * 100), UPower.displayDevice.state === UPowerDeviceState.Charging, true)
pointSize: Style.fontSizeM * scaling
color: UPower.displayDevice.state === UPowerDeviceState.Charging ? Color.mPrimary : Color.mOnSurfaceVariant
}
NText {
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
color: Color.mOnSurfaceVariant
pointSize: Style.fontSizeM * scaling
font.weight: Font.Medium
}
}
// Keyboard layout indicator
RowLayout {
spacing: 6 * scaling
visible: keyboardLayout.currentLayout !== "Unknown"
NIcon {
icon: "keyboard"
pointSize: Style.fontSizeM * scaling
color: Color.mOnSurfaceVariant
}
NText {
text: keyboardLayout.currentLayout
color: Color.mOnSurfaceVariant
pointSize: Style.fontSizeM * scaling
font.weight: Font.Medium
}
}
}
}
// Bottom container with weather, password input and controls
Rectangle {
width: 750 * scaling
height: 220 * scaling
height: Settings.data.general.compactLockScreen ? 120 * scaling : 220 * scaling
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 100 * scaling
radius: 32 * scaling
radius: Style.radiusL * scaling
color: Color.mSurface
border.color: Qt.alpha(Color.mOutline, 0.2)
border.width: 1
ColumnLayout {
anchors.fill: parent
@@ -491,7 +551,7 @@ Loader {
Layout.fillWidth: true
Layout.preferredHeight: 65 * scaling
spacing: 18 * scaling
visible: LocationService.coordinatesReady && LocationService.data.weather !== null
visible: !Settings.data.general.compactLockScreen && LocationService.coordinatesReady && LocationService.data.weather !== null
// Media widget with visualizer
Rectangle {
@@ -695,14 +755,13 @@ Loader {
}
}
// Battery and Keyboard Layout
ColumnLayout {
// Battery and Keyboard Layout (full mode only)
RowLayout {
Layout.preferredWidth: 60 * scaling
spacing: 4 * scaling
// Battery
RowLayout {
Layout.preferredWidth: 60 * scaling
Layout.preferredHeight: 22 * scaling
spacing: 4 * scaling
visible: UPower.displayDevice && UPower.displayDevice.ready && UPower.displayDevice.isPresent
@@ -720,10 +779,10 @@ Loader {
}
}
// Keyboard Layout
RowLayout {
Layout.preferredWidth: 60 * scaling
Layout.preferredHeight: 22 * scaling
spacing: 4 * scaling
visible: keyboardLayout.currentLayout !== "Unknown"
NIcon {
icon: "keyboard"
@@ -739,8 +798,10 @@ Loader {
}
}
}
}
// Password input
RowLayout {
Layout.fillWidth: true
@@ -750,6 +811,7 @@ Loader {
Layout.preferredWidth: Style.marginM * scaling
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 48 * scaling
@@ -894,6 +956,7 @@ Loader {
}
}
Item {
Layout.preferredWidth: Style.marginM * scaling
}
+7
View File
@@ -89,6 +89,13 @@ ColumnLayout {
onToggled: checked => Settings.data.ui.tooltipsEnabled = checked
}
NToggle {
label: I18n.tr("settings.general.ui.compact-lockscreen.label")
description: I18n.tr("settings.general.ui.compact-lockscreen.description")
checked: Settings.data.general.compactLockScreen
onToggled: checked => Settings.data.general.compactLockScreen = checked
}
ColumnLayout {
spacing: Style.marginXXS * scaling
Layout.fillWidth: true