mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Settings: removed isSettings everywhere as we can simply check if defaultValue is provided.
This commit is contained in:
+6
-7
@@ -13,8 +13,7 @@ RowLayout {
|
||||
property bool checked: false
|
||||
property bool hovering: false
|
||||
property int baseSize: Math.round(Style.baseWidgetSize * 0.8 * Style.uiScaleRatio)
|
||||
property bool isSettings: false
|
||||
property var defaultValue: false
|
||||
property var defaultValue: undefined
|
||||
property string settingsPath: ""
|
||||
|
||||
signal toggled(bool checked)
|
||||
@@ -26,16 +25,16 @@ RowLayout {
|
||||
opacity: enabled ? 1.0 : 0.6
|
||||
spacing: Style.marginM
|
||||
|
||||
readonly property bool isValueChanged: isSettings && (checked !== defaultValue)
|
||||
readonly property string indicatorTooltip: isSettings ? I18n.tr("settings.indicator.default-value", {
|
||||
"value": typeof defaultValue === "boolean" ? (defaultValue ? "true" : "false") : String(defaultValue)
|
||||
}) : ""
|
||||
readonly property bool isValueChanged: (defaultValue !== undefined) && (checked !== defaultValue)
|
||||
readonly property string indicatorTooltip: defaultValue !== undefined ? I18n.tr("settings.indicator.default-value", {
|
||||
"value": typeof defaultValue === "boolean" ? (defaultValue ? "true" : "false") : String(defaultValue)
|
||||
}) : ""
|
||||
|
||||
NLabel {
|
||||
label: root.label
|
||||
description: root.description
|
||||
visible: root.label !== "" || root.description !== ""
|
||||
showIndicator: root.isSettings && root.isValueChanged
|
||||
showIndicator: root.isValueChanged
|
||||
indicatorTooltip: root.indicatorTooltip
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user