mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 18:23:19 +00:00
Add color to tags
This commit is contained in:
parent
689eea07a7
commit
dc4f0795c7
4 changed files with 29 additions and 1 deletions
|
@ -43,6 +43,15 @@ Backend::Backend()
|
|||
for (const QJsonValueRef &filePath : jsonFilesPath.toArray()) {
|
||||
mirai.loadFile(filePath.toString().toStdString());
|
||||
}
|
||||
|
||||
auto jsonTagsConfig = json["tags"];
|
||||
if (jsonTagsConfig.isObject()) {
|
||||
for (auto &jsonTagConfigKey : jsonTagsConfig.toObject().keys()) {
|
||||
tagsConfig[jsonTagConfigKey] =
|
||||
jsonTagsConfig.toObject()[jsonTagConfigKey].toObject()["color"].toString();
|
||||
}
|
||||
}
|
||||
|
||||
view = mirai.getTasks();
|
||||
rebuildQMLTasksList();
|
||||
}
|
||||
|
@ -227,3 +236,8 @@ QVariant Backend::getFiles()
|
|||
{
|
||||
return QVariant::fromValue(QMLTasksFiles);
|
||||
}
|
||||
|
||||
QString Backend::getTagColor(QString tag)
|
||||
{
|
||||
return tagsConfig[tag];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue