Commit d425e78c authored by Cyril Rossi's avatar Cyril Rossi
Browse files

KCM KWinEffects highlight effects that are not in default state

add EnabledByDefaultFunctionRole in EffectsModel
parent 93ee2f68
......@@ -97,6 +97,7 @@ QHash<int, QByteArray> EffectsModel::roleNames() const
roleNames[ConfigurableRole] = "ConfigurableRole";
roleNames[ScriptedRole] = QByteArrayLiteral("ScriptedRole");
roleNames[EnabledByDefaultRole] = "EnabledByDefaultRole";
roleNames[EnabledByDefaultFunctionRole] = "EnabledByDefaultFunctionRole";
roleNames[ConfigModuleRole] = "ConfigModuleRole";
return roleNames;
}
......@@ -175,6 +176,8 @@ QVariant EffectsModel::data(const QModelIndex &index, int role) const
return effect.kind == Kind::Scripted;
case EnabledByDefaultRole:
return effect.enabledByDefault;
case EnabledByDefaultFunctionRole:
return effect.enabledByDefaultFunction;
case ConfigModuleRole:
return effect.configModule;
default:
......
......@@ -108,7 +108,11 @@ public:
/**
* Id of the effect's config module, empty if the effect has no config.
*/
ConfigModuleRole
ConfigModuleRole,
/**
* Whether the effect has a function to determine if the effect is enabled by default.
*/
EnabledByDefaultFunctionRole,
};
/**
......
......@@ -11,6 +11,7 @@ import QtQuick.Controls 2.5 as QQC2
import QtQuick.Layouts 1.1
import org.kde.kirigami 2.5 as Kirigami
import org.kde.kcm 1.5 as KCM
Kirigami.SwipeListItem {
id: listItem
......@@ -39,6 +40,10 @@ Kirigami.SwipeListItem {
}
_toggled = false;
}
KCM.SettingHighlighter {
highlight: model.EnabledByDefaultFunctionRole ? parent.checkState !== Qt.PartiallyChecked : parent.checked !== model.EnabledByDefaultRole
}
}
QQC2.CheckBox {
......@@ -46,6 +51,10 @@ Kirigami.SwipeListItem {
visible: model.ExclusiveRole == ""
onToggled: model.StatusRole = checkState
KCM.SettingHighlighter {
highlight: model.EnabledByDefaultFunctionRole ? parent.checkState !== Qt.PartiallyChecked : parent.checked !== model.EnabledByDefaultRole
}
}
ColumnLayout {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment