1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-05 17:17:49 +03:00

fix 30bit color depth that makes dock invisible

--previous approach did not work correctly on 24bit
systems. The new approach should handle properly all
cases.
This commit is contained in:
Michail Vourlakos 2021-12-14 20:12:09 +02:00
parent c15a97bacf
commit c317d3257a

View File

@ -120,6 +120,10 @@ void PanelBackground::updateMaxOpacity(Plasma::Svg *svg)
QImage center = svg->image(QSize(CENTERWIDTH, CENTERHEIGHT), element(svg, "center"));
if (center.format() != QImage::Format_ARGB32_Premultiplied) {
center.convertTo(QImage::Format_ARGB32_Premultiplied);
}
float alphasum{0};
//! calculating the mid opacity (this is needed in order to handle Oxygen
@ -163,6 +167,10 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg)
QString cornerId = (topLeftCorner ? "mask-topleft" : "mask-bottomright");
QImage corner = svg->image(svg->elementSize(cornerId), cornerId);
if (corner.format() != QImage::Format_ARGB32_Premultiplied) {
corner.convertTo(QImage::Format_ARGB32_Premultiplied);
}
int baseRow = (topLeftCorner ? corner.height()-1 : 0);
int baseCol = (topLeftCorner ? corner.width()-1 : 0);
@ -327,6 +335,10 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg)
QString cornerId = (topLeftCorner ? "shadow-topleft" : "shadow-bottomright");
QImage corner = svg->image(svg->elementSize(cornerId), cornerId);
if (corner.format() != QImage::Format_ARGB32_Premultiplied) {
corner.convertTo(QImage::Format_ARGB32_Premultiplied);
}
int baseRow = (topLeftCorner ? corner.height()-1 : 0);
int baseCol = (topLeftCorner ? corner.width()-1 : 0);
@ -484,6 +496,10 @@ void PanelBackground::updateRoundnessFallback(Plasma::Svg *svg)
QString cornerId = element(svg, (m_location == Plasma::Types::LeftEdge ? "bottomright" : "topleft"));
QImage corner = svg->image(svg->elementSize(cornerId), cornerId);
if (corner.format() != QImage::Format_ARGB32_Premultiplied) {
corner.convertTo(QImage::Format_ARGB32_Premultiplied);
}
int discovRow = (m_location == Plasma::Types::LeftEdge ? corner.height()-1 : 0);
int discovCol{0};
//int discovCol = (m_location == Plasma::Types::LeftEdge ? corner.width()-1 : 0);
@ -552,6 +568,10 @@ void PanelBackground::updateShadow(Plasma::Svg *svg)
QImage border = svg->image(svg->elementSize(borderId), borderId);
if (border.format() != QImage::Format_ARGB32_Premultiplied) {
border.convertTo(QImage::Format_ARGB32_Premultiplied);
}
//! find shadow size through, plasma theme
int themeshadowsize{0};