From eedcb1c2b56de051bf3b16cce78f0af01281b45c Mon Sep 17 00:00:00 2001 From: emeric Date: Mon, 7 May 2018 13:20:49 +0200 Subject: [PATCH] Added actual colors to tags --- approot/explore.xml | 2 +- docroot/css/lms.css | 40 +++++++++++++++++++++++++++++++++++++++ src/ui/LmsApplication.cpp | 8 +++----- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/approot/explore.xml b/approot/explore.xml index 9cb083b3..446a3893 100644 --- a/approot/explore.xml +++ b/approot/explore.xml @@ -17,7 +17,7 @@ - ${}${} ${name} + ${}${} ${name} diff --git a/docroot/css/lms.css b/docroot/css/lms.css index b259d5a1..4ad03b9a 100644 --- a/docroot/css/lms.css +++ b/docroot/css/lms.css @@ -1,4 +1,44 @@ +.Lms-cluster-type-0 { + background-color: darkslategrey; +} + +.Lms-cluster-type-1 { + background-color: darkblue; +} + +.Lms-cluster-type-2 { + background-color: darkgrey; +} + +.Lms-cluster-type-3 { + background-color: darkorchid; +} + +.Lms-cluster-type-4 { + background-color: darkslateblue; +} + +.Lms-cluster-type-5 { + background-color: darkslateblue; +} + +.Lms-cluster-type-6 { + background-color: darkolivegreen; +} + +.Lms-cluster-type-7 { + background-color: darkred; +} + +.Lms-cluster-type-8 { + background-color: darkviolet; +} + +.Lms-cluster-type-9 { + background-color: darkturquoise; +} + .Lms-playqueue-selected { font-weight: bold; } diff --git a/src/ui/LmsApplication.cpp b/src/ui/LmsApplication.cpp index 49528722..1dedd55f 100644 --- a/src/ui/LmsApplication.cpp +++ b/src/ui/LmsApplication.cpp @@ -175,16 +175,14 @@ LmsApplication::createReleaseAnchor(Database::Release::pointer release, bool add std::unique_ptr LmsApplication::createCluster(Database::Cluster::pointer cluster, bool canDelete) { - LMS_LOG(UI, DEBUG) << " Creating cluster for name " << cluster->getName(); - auto res = std::make_unique(Wt::WString::tr("Lms.Explore.template.cluster-entry")); + std::string styleClass = "Lms-cluster-type-" + std::to_string(cluster->getType().id() % 10); + + auto res = std::make_unique(Wt::WString::tr("Lms.Explore.template.cluster-entry").arg(styleClass)); res->addFunction("tr", &Wt::WTemplate::Functions::tr); res->bindString("name", Wt::WString::fromUTF8(cluster->getName()), Wt::TextFormat::Plain); res->setCondition("if-can-delete", canDelete); - std::string styleClass = "cluster-type-" + std::to_string(cluster->getType().id() % 10); - res->setStyleClass(styleClass); - return res; }