identify single color background also

--Latte now does not only identify background files
but single colors also. At the same time the new
implementation is multi-screen aware. That means
that two different top panels at two different screens
can be color independent, meaning the first could
be lightish when it is transparent and the latter
darkish

BUG: 402143
pull/4/head
Michail Vourlakos 6 years ago
parent 418799ed30
commit b6ae8d66ee

@ -188,14 +188,20 @@ float BackgroundCache::luminasFor(QString activity, QString screen, Plasma::Type
float BackgroundCache::luminasFromFile(QString imageFile, Plasma::Types::Location location)
{
QImage image(imageFile);
if (m_luminasCache.keys().contains(imageFile)) {
if (m_luminasCache[imageFile].keys().contains(location)) {
return m_luminasCache[imageFile].value(location);
}
}
//! if it is a color
if (imageFile.startsWith("#")) {
return Latte::colorLumina(QColor(imageFile));
}
//! if it is a local image
QImage image(imageFile);
if (image.format() != QImage::Format_Invalid) {
int maskHeight = (0.08 * image.height());
int maskWidth = (0.05 * image.width());

Loading…
Cancel
Save