mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Reapply "ClockSettings: add tooltip format option"
This reverts commit 1210f7903e.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------
|
||||
|
||||
Reference in New Issue
Block a user