KDeclarative

SettingStateBinding.qml
1 /*
2  SPDX-FileCopyrightText: 2020 Kevin Ottens <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 import QtQuick 2.8
8 import QtQml 2.14
9 import QtQuick.Layouts 1.3
10 import org.kde.kcm 1.3 as KCM
11 import org.kde.kcm.private 1.3
12 
24 Item {
25  id: root
26 
32  property alias target: helper.target
33 
38  property alias configObject: settingState.configObject
39 
44  property alias settingName: settingState.settingName
45 
55  property bool extraEnabledConditions: true
56 
57 
65  readonly property bool nonDefaultHighlightVisible: helper.highlight && kcm.defaultsIndicatorsVisible
66 
67  Binding {
68  when: helper.target
69  target: helper.target
70  property: "enabled"
71  value: extraEnabledConditions && !settingState.immutable
72  restoreMode: Binding.RestoreBinding
73  }
74 
75  Binding {
76  when: helper.target
77  target: helper
78  property: "highlight"
79  value: !settingState.defaulted
80  restoreMode: Binding.RestoreBinding
81  }
82 
83  KCM.SettingStateProxy {
84  id: settingState
85  }
86 
87  SettingHighlighterPrivate {
88  id: helper
89  defaultIndicatorVisible: kcm.defaultsIndicatorsVisible
90  }
91 
92  Component.onCompleted: {
93  helper.updateTarget();
94  }
95 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.