NSettingsIndicator: add default setting indicator (#1080)

N*Widgets: show NSettingsIndicator if settings are not default
This commit is contained in:
Ly-sec
2025-12-20 14:55:09 +01:00
parent c8b76c7b90
commit 9cb6613308
20 changed files with 793 additions and 411 deletions
+11
View File
@@ -19,6 +19,9 @@ RowLayout {
property bool enabled: true
property bool hovering: false
property int baseSize: Style.baseWidgetSize
property bool isSettings: false
property var defaultValue: 0
property string settingsPath: ""
// Convenience properties for common naming
property alias minimum: root.from
@@ -37,6 +40,11 @@ RowLayout {
Layout.fillWidth: true
readonly property bool isValueChanged: isSettings && (value !== defaultValue)
readonly property string indicatorTooltip: isSettings ? I18n.tr("settings.indicator.default-value", {
"value": String(defaultValue)
}) : ""
Timer {
id: repeatTimer
repeat: true
@@ -78,6 +86,8 @@ RowLayout {
NLabel {
label: root.label
description: root.description
showIndicator: root.isSettings && root.isValueChanged
indicatorTooltip: root.indicatorTooltip
}
// Main spinbox container
@@ -405,4 +415,5 @@ RowLayout {
}
}
}
}