Add per-tool settings and gesture customization

This commit is contained in:
ajp_anton
2026-09-05 05:02:34 +00:00
parent d6f30c5735
commit 38142b9499
26 changed files with 1383 additions and 83 deletions
+14 -5
View File
@@ -42,7 +42,10 @@ QVariant ToolModel::data(const QModelIndex &index, int role) const
case UpdateAvailableRole:
return tool.updateAvailable;
case ConfigurableRole:
return tool.installed && tool.packageName == QStringLiteral("plasma-fingerprint-workaround");
return tool.installed
&& (tool.packageName == QStringLiteral("plasma-fingerprint-workaround")
|| tool.packageName == QStringLiteral("plasma-task-group-shortcuts")
|| tool.packageName == QStringLiteral("touchpad-hold-tap"));
default:
return {};
}
@@ -83,16 +86,15 @@ void ToolModel::setPackages(const QList<PackageRecord> &installed,
tool.packageName = package.name;
tool.availableVersion = package.version;
tool.architecture = package.architecture;
tool.summary = package.summary;
if (!tool.installed) {
tool.summary = package.summary;
}
tool.available = true;
tool.updateAvailable = tool.installed && updates.contains(package.name);
}
QList<Tool> merged = tools.values();
std::ranges::sort(merged, [](const Tool &left, const Tool &right) {
if (left.installed != right.installed) {
return left.installed > right.installed;
}
return left.packageName < right.packageName;
});
@@ -107,3 +109,10 @@ bool ToolModel::mayInstall(const QString &packageName) const
return tool.packageName == packageName && tool.available;
});
}
bool ToolModel::mayRemove(const QString &packageName) const
{
return std::ranges::any_of(m_tools, [&packageName](const Tool &tool) {
return tool.packageName == packageName && tool.installed;
});
}