Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Line(s) | 148 | QQC2.Label { | |||
---|---|---|---|---|---|
149 | id: itemNameLabel | 149 | id: itemNameLabel | ||
150 | text: model.name | 150 | text: model.name | ||
151 | horizontalAlignment: Qt.AlignLeft | 151 | horizontalAlignment: Qt.AlignLeft | ||
152 | Layout.preferredWidth: implicitWidth | 152 | Layout.preferredWidth: implicitWidth | ||
153 | Layout.fillWidth: true | 153 | Layout.fillWidth: true | ||
154 | Layout.alignment: Qt.AlignVCenter | 154 | Layout.alignment: Qt.AlignVCenter | ||
155 | QQC2.ToolTip { | 155 | QQC2.ToolTip { | ||
156 | text: model.description | 156 | text: model.description | ||
157 | visible: hovered && (model.description != "") | 157 | visible: hovered && (model.description.length > 0) | ||
158 | } | 158 | } | ||
159 | } | 159 | } | ||
160 | QQC2.Label { | 160 | QQC2.Label { | ||
161 | id: suggestedLabel | 161 | id: suggestedLabel | ||
162 | text: formatValue(model.suggested, model.type, model.options) | 162 | text: formatValue(model.suggested, model.type, model.options) | ||
163 | horizontalAlignment: Text.AlignRight | 163 | horizontalAlignment: Text.AlignRight | ||
164 | elide: Text.ElideRight | 164 | elide: Text.ElideRight | ||
165 | opacity: 0.7 | 165 | opacity: 0.7 | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 244 | filterRowCallback: (source_row, source_parent) => { | |||
248 | var isOptional = sourceModel.data(index, RulesModel.SelectableRole); | 248 | var isOptional = sourceModel.data(index, RulesModel.SelectableRole); | ||
249 | var isEnabled = sourceModel.data(index, RulesModel.EnabledRole); | 249 | var isEnabled = sourceModel.data(index, RulesModel.EnabledRole); | ||
250 | 250 | | |||
251 | var showItem = hasSuggestion || (!onlySuggestions && isOptional && !isEnabled); | 251 | var showItem = hasSuggestion || (!onlySuggestions && isOptional && !isEnabled); | ||
252 | 252 | | |||
253 | if (!showItem) { | 253 | if (!showItem) { | ||
254 | return false; | 254 | return false; | ||
255 | } | 255 | } | ||
256 | if (filterString != "") { | 256 | if (filterString.length > 0) { | ||
257 | return sourceModel.data(index, RulesModel.NameRole).toLowerCase().includes(filterString) | 257 | return sourceModel.data(index, RulesModel.NameRole).toLowerCase().includes(filterString) | ||
258 | } | 258 | } | ||
259 | return true; | 259 | return true; | ||
260 | } | 260 | } | ||
261 | } | 261 | } | ||
262 | 262 | | |||
263 | } | 263 | } |