remove buttom measurement for LockScreen

This commit is contained in:
notiant
2026-01-15 14:49:11 +01:00
committed by GitHub
parent cb5c9767bd
commit 8b62b971d8
14 changed files with 15 additions and 62 deletions
+2 -2
View File
@@ -364,7 +364,7 @@
"download": "Herunterladen",
"duration": "Dauer",
"enabled": "Aktiviert",
"events": "Veranstaltungen",
"events": "Ereignisse",
"execute": "Ausführen",
"focus": "Fokus",
"frequency": "Frequenz",
@@ -749,7 +749,7 @@
"templates-filter-label": "Nach Kategorie filtern",
"templates-misc-description": "Erstellen Sie Ihre eigenen Vorlagen.",
"templates-misc-label": "Erweitert",
"templates-misc-user-templates-description": "Nur aktivieren, wenn Sie wissen, was Sie tun — weitere Informationen finden Sie in unserer Online-Dokumentation",
"templates-misc-user-templates-description": "Nur aktivieren, wenn Sie wissen, was Sie tun — weitere Informationen finden Sie in unserer Online-Dokumentation.",
"templates-misc-user-templates-label": "Benutzer-Vorlagen aktivieren",
"templates-none-detected": "Keine erkannt",
"templates-write-path": "Schreibt: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Filter by category",
"templates-misc-description": "Create your own templates.",
"templates-misc-label": "Advanced",
"templates-misc-user-templates-description": "Only enable if you know what you are doing — refer to our online documentation",
"templates-misc-user-templates-description": "Only enable if you know what you are doing — refer to our online documentation.",
"templates-misc-user-templates-label": "Enable user templates",
"templates-none-detected": "None detected",
"templates-write-path": "Writes: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Filtrar por categoría",
"templates-misc-description": "Crea tus propias plantillas.",
"templates-misc-label": "Avanzado",
"templates-misc-user-templates-description": "Solo habilita si sabes lo que estás haciendo — consulta nuestra documentación en línea",
"templates-misc-user-templates-description": "Solo habilita si sabes lo que estás haciendo — consulta nuestra documentación en línea.",
"templates-misc-user-templates-label": "Habilitar plantillas de usuario",
"templates-none-detected": "Ninguno detectado",
"templates-write-path": "Escribe: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Filtrer par catégorie",
"templates-misc-description": "Créez vos propres modèles.",
"templates-misc-label": "Avancé",
"templates-misc-user-templates-description": "N'activez que si vous savez ce que vous faites — consultez notre documentation en ligne",
"templates-misc-user-templates-description": "N'activez que si vous savez ce que vous faites — consultez notre documentation en ligne.",
"templates-misc-user-templates-label": "Activer les modèles utilisateur",
"templates-none-detected": "Aucun détecté",
"templates-write-path": "Écrit : {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Szűrés kategória szerint",
"templates-misc-description": "Hozzon létre saját sablonokat.",
"templates-misc-label": "Haladó",
"templates-misc-user-templates-description": "Csak akkor engedélyezze, ha tudja, mit csinál — lásd az online dokumentációt",
"templates-misc-user-templates-description": "Csak akkor engedélyezze, ha tudja, mit csinál — lásd az online dokumentációt.",
"templates-misc-user-templates-label": "Felhasználói sablonok engedélyezése",
"templates-none-detected": "Nem észlelt semmit",
"templates-write-path": "Írja: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Li gorî kategoriyê parzûn bike",
"templates-misc-description": "Şablonên xwe biafirîne.",
"templates-misc-label": "Pêşketî",
"templates-misc-user-templates-description": "Tenê eger tu dizanî çi dikî çalak bike — serî li belgekirina me ya serhêl bide",
"templates-misc-user-templates-description": "Tenê eger tu dizanî çi dikî çalak bike — serî li belgekirina me ya serhêl bide.",
"templates-misc-user-templates-label": "Şablonên bikarhêner çalak bike",
"templates-none-detected": "Tiştek nehat dîtin",
"templates-write-path": "Dinivîse: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Filteren op categorie",
"templates-misc-description": "Maak uw eigen sjablonen.",
"templates-misc-label": "Geavanceerd",
"templates-misc-user-templates-description": "Alleen inschakelen als u weet wat u doet — raadpleeg onze online documentatie",
"templates-misc-user-templates-description": "Alleen inschakelen als u weet wat u doet — raadpleeg onze online documentatie.",
"templates-misc-user-templates-label": "Gebruikerssjablonen inschakelen",
"templates-none-detected": "Geen gedetecteerd",
"templates-write-path": "Schrijft: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Filtruj według kategorii",
"templates-misc-description": "Twórz własne szablony.",
"templates-misc-label": "Zaawansowane",
"templates-misc-user-templates-description": "Włącz tylko jeśli wiesz co robisz — zapoznaj się z dokumentacją online",
"templates-misc-user-templates-description": "Włącz tylko jeśli wiesz co robisz — zapoznaj się z dokumentacją online.",
"templates-misc-user-templates-label": "Włącz szablony użytkownika",
"templates-none-detected": "Nie wykryto",
"templates-write-path": "Zapisuje: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Filtrar por categoria",
"templates-misc-description": "Crie seus próprios modelos.",
"templates-misc-label": "Avançado",
"templates-misc-user-templates-description": "Ative apenas se souber o que está fazendo — consulte nossa documentação online",
"templates-misc-user-templates-description": "Ative apenas se souber o que está fazendo — consulte nossa documentação online.",
"templates-misc-user-templates-label": "Ativar modelos do usuário",
"templates-none-detected": "Nenhum detectado",
"templates-write-path": "Escreve: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Фильтровать по категории",
"templates-misc-description": "Создайте свои собственные шаблоны.",
"templates-misc-label": "Дополнительно",
"templates-misc-user-templates-description": "Включайте только если вы знаете, что делаете — обратитесь к нашей онлайн-документации",
"templates-misc-user-templates-description": "Включайте только если вы знаете, что делаете — обратитесь к нашей онлайн-документации.",
"templates-misc-user-templates-label": "Включить пользовательские шаблоны",
"templates-none-detected": "Не обнаружено",
"templates-write-path": "Записывает: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Kategoriye göre filtrele",
"templates-misc-description": "Kendi şablonlarınızı oluşturun.",
"templates-misc-label": "Gelişmiş",
"templates-misc-user-templates-description": "Yalnızca ne yaptığınızı biliyorsanız etkinleştirin — çevrimiçi belgelerimize bakın",
"templates-misc-user-templates-description": "Yalnızca ne yaptığınızı biliyorsanız etkinleştirin — çevrimiçi belgelerimize bakın.",
"templates-misc-user-templates-label": "Kullanıcı şablonlarını etkinleştir",
"templates-none-detected": "Hiçbiri algılanmadı",
"templates-write-path": "Yazıyor: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "Фільтрувати за категорією",
"templates-misc-description": "Створіть власні шаблони.",
"templates-misc-label": "Розширено",
"templates-misc-user-templates-description": "Увімкніть лише якщо ви знаєте, що робите — зверніться до нашої онлайн-документації",
"templates-misc-user-templates-description": "Увімкніть лише якщо ви знаєте, що робите — зверніться до нашої онлайн-документації.",
"templates-misc-user-templates-label": "Увімкнути користувацькі шаблони",
"templates-none-detected": "Не виявлено",
"templates-write-path": "Записує: {filepath}",
+1 -1
View File
@@ -749,7 +749,7 @@
"templates-filter-label": "按类别筛选",
"templates-misc-description": "创建您自己的模板。",
"templates-misc-label": "高级",
"templates-misc-user-templates-description": "仅在您知道自己在做什么时启用,请参阅我们的在线文档",
"templates-misc-user-templates-description": "仅在您知道自己在做什么时启用,请参阅我们的在线文档",
"templates-misc-user-templates-label": "启用用户模板",
"templates-none-detected": "未检测到",
"templates-write-path": "写入:{filepath}",
+1 -48
View File
@@ -684,54 +684,7 @@ Loader {
radius: Style.radiusL
color: Color.mSurface
// Measure text widths to determine minimum button width (for container width calculation)
Item {
id: buttonRowTextMeasurer
visible: false
property real iconSize: Settings.data.general.compactLockScreen ? Style.fontSizeM : Style.fontSizeL
property real fontSize: Settings.data.general.compactLockScreen ? Style.fontSizeS : Style.fontSizeM
property real spacing: Style.marginXS
property real padding: 18 // Approximate horizontal padding per button
// Measure all button text widths
NText {
id: logoutText
text: I18n.tr("common.logout")
font.pointSize: buttonRowTextMeasurer.fontSize
}
NText {
id: suspendText
text: I18n.tr("common.suspend")
font.pointSize: buttonRowTextMeasurer.fontSize
}
NText {
id: hibernateText
text: Settings.data.general.showHibernateOnLockScreen ? I18n.tr("common.hibernate") : ""
font.pointSize: buttonRowTextMeasurer.fontSize
}
NText {
id: rebootText
text: I18n.tr("common.reboot")
font.pointSize: buttonRowTextMeasurer.fontSize
}
NText {
id: shutdownText
text: I18n.tr("common.shutdown")
font.pointSize: buttonRowTextMeasurer.fontSize
}
// Calculate maximum width needed
property real maxTextWidth: Math.max(logoutText.implicitWidth, Math.max(suspendText.implicitWidth, Math.max(hibernateText.implicitWidth, Math.max(rebootText.implicitWidth, shutdownText.implicitWidth))))
property real minButtonWidth: maxTextWidth + iconSize + spacing + padding
}
// Calculate minimum width based on button requirements
// Button row needs: margins + buttons (4 or 5 depending on hibernate visibility) + spacings + margins
// Plus ColumnLayout margins (14 on each side = 28 total)
property int buttonCount: Settings.data.general.showHibernateOnLockScreen ? 5 : 4
property int spacingCount: buttonCount - 1
property real minButtonRowWidth: buttonRowTextMeasurer.minButtonWidth > 0 ? (buttonCount * buttonRowTextMeasurer.minButtonWidth) + (spacingCount * 10) + (2 * Style.marginM) + 28 + (2 * Style.marginM) : 750
width: Math.max(750, minButtonRowWidth)
width: Settings.data.general.showHibernateOnLockScreen ? 800 : 750
ColumnLayout {
anchors.fill: parent