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:
@@ -17,8 +17,7 @@ ColumnLayout {
|
||||
property string fontFamily: Settings.data.ui.fontDefault
|
||||
property real fontSize: Style.fontSizeS
|
||||
property int fontWeight: Style.fontWeightRegular
|
||||
property bool isSettings: false
|
||||
property var defaultValue: ""
|
||||
property var defaultValue: undefined
|
||||
property string settingsPath: ""
|
||||
|
||||
property alias text: input.text
|
||||
@@ -30,10 +29,10 @@ ColumnLayout {
|
||||
|
||||
spacing: Style.marginS
|
||||
|
||||
readonly property bool isValueChanged: isSettings && (text !== defaultValue)
|
||||
readonly property string indicatorTooltip: isSettings ? I18n.tr("settings.indicator.default-value", {
|
||||
"value": defaultValue === "" ? "(empty)" : String(defaultValue)
|
||||
}) : ""
|
||||
readonly property bool isValueChanged: (defaultValue !== undefined) && (text !== defaultValue)
|
||||
readonly property string indicatorTooltip: defaultValue !== undefined ? I18n.tr("settings.indicator.default-value", {
|
||||
"value": defaultValue === "" ? "(empty)" : String(defaultValue)
|
||||
}) : ""
|
||||
|
||||
NLabel {
|
||||
label: root.label
|
||||
@@ -42,7 +41,7 @@ ColumnLayout {
|
||||
descriptionColor: root.descriptionColor
|
||||
visible: root.label !== "" || root.description !== ""
|
||||
Layout.fillWidth: true
|
||||
showIndicator: root.isSettings && root.isValueChanged
|
||||
showIndicator: root.isValueChanged
|
||||
indicatorTooltip: root.indicatorTooltip
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user