Clock: removed useMonospacedFont to keep things simple, + translations + cleanup

This commit is contained in:
ItsLemmy
2025-10-01 09:20:14 -04:00
parent cad8fd671f
commit f37625719d
10 changed files with 59 additions and 24 deletions
+11 -1
View File
@@ -1030,7 +1030,17 @@
"label": "Vertikale Statusleiste",
"description": "Verwenden Sie ein Leerzeichen, um jeden Teil in eine neue Zeile zu trennen."
},
"preview": "Vorschau"
"preview": "Vorschau",
"custom-font": {
"description": "Wähle eine benutzerdefinierte Schriftart für die Uhrenanzeige aus.",
"label": "Benutzerdefinierte Schriftart",
"placeholder": "Benutzerdefinierte Schriftart auswählen...",
"search-placeholder": "Schriftarten suchen..."
},
"use-custom-font": {
"description": "Überschreibe die Standard-Schriftauswahl mit einer benutzerdefinierten Schriftart für die Uhr.",
"label": "Benutzerdefinierte Schriftart verwenden"
}
},
"taskbar": {
"only-active-workspaces": {
+11 -1
View File
@@ -1009,7 +1009,17 @@
"label": "Barra vertical",
"description": "Usa un espacio para separar cada parte en una nueva línea."
},
"preview": "Vista previa"
"preview": "Vista previa",
"custom-font": {
"description": "Seleccionar una fuente personalizada para la visualización del reloj.",
"label": "Fuente personalizada",
"placeholder": "Seleccionar fuente personalizada...",
"search-placeholder": "Buscar fuentes..."
},
"use-custom-font": {
"description": "Anular la selección de fuente predeterminada con una fuente personalizada para el reloj.",
"label": "Usar fuente personalizada"
}
},
"taskbar": {
"only-active-workspaces": {
+11 -1
View File
@@ -1009,7 +1009,17 @@
"label": "Barre verticale",
"description": "Utilisez un espace pour séparer chaque partie sur une nouvelle ligne."
},
"preview": "Aperçu"
"preview": "Aperçu",
"custom-font": {
"description": "Sélectionner une police personnalisée pour l'affichage de l'horloge.",
"label": "Police personnalisée",
"placeholder": "Sélectionner une police personnalisée...",
"search-placeholder": "Rechercher des polices..."
},
"use-custom-font": {
"description": "Remplacez la police par défaut par une police personnalisée pour l'horloge.",
"label": "Utiliser une police personnalisée."
}
},
"taskbar": {
"only-active-workspaces": {
+11 -1
View File
@@ -1009,7 +1009,17 @@
"label": "Barra vertical",
"description": "Use um espaço para separar cada parte em uma nova linha."
},
"preview": "Pré-visualização"
"preview": "Pré-visualização",
"custom-font": {
"description": "Selecione uma fonte personalizada para a exibição do relógio.",
"label": "Fonte personalizada",
"placeholder": "Selecionar fonte personalizada...",
"search-placeholder": "Procurar fontes..."
},
"use-custom-font": {
"description": "Substitua a fonte padrão por uma fonte personalizada para o relógio.",
"label": "Usar fonte personalizada"
}
},
"taskbar": {
"only-active-workspaces": {
+11 -1
View File
@@ -1009,7 +1009,17 @@
"label": "垂直栏",
"description": "使用空格将每个部分分隔到新行。"
},
"preview": "预览"
"preview": "预览",
"custom-font": {
"description": "选择时钟显示使用的自定义字体。",
"label": "自定义字体",
"placeholder": "选择自定义字体...",
"search-placeholder": "搜索字体..."
},
"use-custom-font": {
"description": "使用自定义字体覆盖时钟的默认字体选择。",
"label": "使用自定义字体"
}
},
"taskbar": {
"only-active-workspaces": {
+2 -3
View File
@@ -36,7 +36,6 @@ Rectangle {
// Resolve settings: try user settings or defaults from BarWidgetRegistry
readonly property bool usePrimaryColor: widgetSettings.usePrimaryColor !== undefined ? widgetSettings.usePrimaryColor : widgetMetadata.usePrimaryColor
property bool useMonospacedFont: widgetSettings.useMonospacedFont !== undefined ? widgetSettings.useMonospacedFont : widgetMetadata.useMonospacedFont
readonly property bool useCustomFont: widgetSettings.useCustomFont !== undefined ? widgetSettings.useCustomFont : widgetMetadata.useCustomFont
readonly property string customFont: widgetSettings.customFont !== undefined ? widgetSettings.customFont : widgetMetadata.customFont
readonly property string formatHorizontal: widgetSettings.formatHorizontal !== undefined ? widgetSettings.formatHorizontal : widgetMetadata.formatHorizontal
@@ -67,7 +66,7 @@ Rectangle {
NText {
visible: text !== ""
text: modelData
family: useCustomFont && customFont ? customFont : (useMonospacedFont ? Settings.data.ui.fontFixed : Settings.data.ui.fontDefault)
family: useCustomFont && customFont ? customFont : Settings.data.ui.fontDefault
pointSize: {
if (repeater.model.length == 1) {
return Style.fontSizeS * scaling
@@ -97,7 +96,7 @@ Rectangle {
delegate: NText {
visible: text !== ""
text: modelData
family: useCustomFont && customFont ? customFont : (useMonospacedFont ? Settings.data.ui.fontFixed : Settings.data.ui.fontDefault)
family: useCustomFont && customFont ? customFont : Settings.data.ui.fontDefault
pointSize: Style.fontSizeS * scaling
font.weight: Style.fontWeightBold
color: usePrimaryColor ? Color.mPrimary : Color.mOnSurface
@@ -16,7 +16,6 @@ ColumnLayout {
// Local state
property bool valueUsePrimaryColor: widgetData.usePrimaryColor !== undefined ? widgetData.usePrimaryColor : widgetMetadata.usePrimaryColor
property bool valueUseMonospacedFont: widgetData.useMonospacedFont !== undefined ? widgetData.useMonospacedFont : widgetMetadata.useMonospacedFont
property bool valueUseCustomFont: widgetData.useCustomFont !== undefined ? widgetData.useCustomFont : widgetMetadata.useCustomFont
property string valueCustomFont: widgetData.customFont !== undefined ? widgetData.customFont : widgetMetadata.customFont
property string valueFormatHorizontal: widgetData.formatHorizontal !== undefined ? widgetData.formatHorizontal : widgetMetadata.formatHorizontal
@@ -31,7 +30,6 @@ ColumnLayout {
function saveSettings() {
var settings = Object.assign({}, widgetData || {})
settings.usePrimaryColor = valueUsePrimaryColor
settings.useMonospacedFont = valueUseMonospacedFont
settings.useCustomFont = valueUseCustomFont
settings.customFont = valueCustomFont
settings.formatHorizontal = valueFormatHorizontal.trim()
@@ -74,14 +72,6 @@ ColumnLayout {
onToggled: checked => valueUsePrimaryColor = checked
}
NToggle {
Layout.fillWidth: true
label: I18n.tr("bar.widget-settings.clock.use-monospaced-font.label")
description: I18n.tr("bar.widget-settings.clock.use-monospaced-font.description")
checked: valueUseMonospacedFont
onToggled: checked => valueUseMonospacedFont = checked
}
NToggle {
Layout.fillWidth: true
label: I18n.tr("bar.widget-settings.clock.use-custom-font.label")
-1
View File
@@ -237,7 +237,6 @@ ColumnLayout {
}
}
ColumnLayout {
NLabel {
label: I18n.tr("settings.general.fonts.default.scale.label")
-1
View File
@@ -56,7 +56,6 @@ Singleton {
"Clock": {
"allowUserSettings": true,
"usePrimaryColor": true,
"useMonospacedFont": true,
"useCustomFont": false,
"customFont": "",
"formatHorizontal": "HH:mm ddd, MMM dd",
+2 -4
View File
@@ -155,9 +155,7 @@ Singleton {
function refreshBrightnessFromSystem() {
if (!monitor.isDdc && !monitor.isAppleDisplay) {
// For internal displays, query the system directly
refreshProc.command = ["sh", "-c",
"cat " + monitor.brightnessPath + " && " +
"cat " + monitor.maxBrightnessPath]
refreshProc.command = ["sh", "-c", "cat " + monitor.brightnessPath + " && " + "cat " + monitor.maxBrightnessPath]
refreshProc.running = true
} else if (monitor.isDdc) {
// For DDC displays, get the current value
@@ -179,7 +177,7 @@ Singleton {
onFileChanged: {
// When a file change is detected, actively refresh from system
// to ensure we get the most up-to-date value
Qt.callLater(function() {
Qt.callLater(() => {
monitor.refreshBrightnessFromSystem()
})
}