Reapply "ClockSettings: add tooltip format option"

This reverts commit 1210f7903e.
This commit is contained in:
Ly-sec
2025-12-27 17:16:33 +01:00
parent 1210f7903e
commit 3a98f926f9
15 changed files with 110 additions and 14 deletions
@@ -20,6 +20,7 @@ ColumnLayout {
property string valueCustomFont: widgetData.customFont !== undefined ? widgetData.customFont : widgetMetadata.customFont
property string valueFormatHorizontal: widgetData.formatHorizontal !== undefined ? widgetData.formatHorizontal : widgetMetadata.formatHorizontal
property string valueFormatVertical: widgetData.formatVertical !== undefined ? widgetData.formatVertical : widgetMetadata.formatVertical
property string valueTooltipFormat: widgetData.tooltipFormat !== undefined ? widgetData.tooltipFormat : widgetMetadata.tooltipFormat
// Track the currently focused input field
property var focusedInput: null
@@ -34,6 +35,7 @@ ColumnLayout {
settings.customFont = valueCustomFont;
settings.formatHorizontal = valueFormatHorizontal.trim();
settings.formatVertical = valueFormatVertical.trim();
settings.tooltipFormat = valueTooltipFormat.trim();
return settings;
}
@@ -161,6 +163,25 @@ ColumnLayout {
}
}
}
NTextInput {
id: inputTooltip
Layout.fillWidth: true
label: I18n.tr("bar.widget-settings.clock.tooltip-format.label")
description: I18n.tr("bar.widget-settings.clock.tooltip-format.description")
placeholderText: "HH:mm, ddd MMM dd"
text: valueTooltipFormat
onTextChanged: valueTooltipFormat = text
Component.onCompleted: {
if (inputItem) {
inputItem.onActiveFocusChanged.connect(function () {
if (inputItem.activeFocus) {
root.focusedInput = inputTooltip;
}
});
}
}
}
}
// --------------