still support Qt5 >= 5.12

BUG:447111
work/m_layershell
Michail Vourlakos 3 years ago
parent 14be8a9e71
commit 67c38b194f

@ -6,6 +6,7 @@
#include "panelbackground.h"
// local
#include <config-latte.h>
#include "theme.h"
// Qt
@ -121,7 +122,11 @@ void PanelBackground::updateMaxOpacity(Plasma::Svg *svg)
QImage center = svg->image(QSize(CENTERWIDTH, CENTERHEIGHT), element(svg, "center"));
if (center.format() != QImage::Format_ARGB32_Premultiplied) {
#if QT5_VERSION_MINOR >= 13
center.convertTo(QImage::Format_ARGB32_Premultiplied);
#else
center = center.convertToFormat(QImage::Format_ARGB32_Premultiplied);
#endif
}
float alphasum{0};
@ -168,7 +173,11 @@ void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg)
QImage corner = svg->image(svg->elementSize(cornerId), cornerId);
if (corner.format() != QImage::Format_ARGB32_Premultiplied) {
#if QT5_VERSION_MINOR >= 13
corner.convertTo(QImage::Format_ARGB32_Premultiplied);
#else
corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied);
#endif
}
int baseRow = (topLeftCorner ? corner.height()-1 : 0);
@ -336,7 +345,11 @@ void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg)
QImage corner = svg->image(svg->elementSize(cornerId), cornerId);
if (corner.format() != QImage::Format_ARGB32_Premultiplied) {
#if QT5_VERSION_MINOR >= 13
corner.convertTo(QImage::Format_ARGB32_Premultiplied);
#else
corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied);
#endif
}
int baseRow = (topLeftCorner ? corner.height()-1 : 0);
@ -497,7 +510,11 @@ void PanelBackground::updateRoundnessFallback(Plasma::Svg *svg)
QImage corner = svg->image(svg->elementSize(cornerId), cornerId);
if (corner.format() != QImage::Format_ARGB32_Premultiplied) {
#if QT5_VERSION_MINOR >= 13
corner.convertTo(QImage::Format_ARGB32_Premultiplied);
#else
corner = corner.convertToFormat(QImage::Format_ARGB32_Premultiplied);
#endif
}
int discovRow = (m_location == Plasma::Types::LeftEdge ? corner.height()-1 : 0);
@ -569,7 +586,11 @@ void PanelBackground::updateShadow(Plasma::Svg *svg)
QImage border = svg->image(svg->elementSize(borderId), borderId);
if (border.format() != QImage::Format_ARGB32_Premultiplied) {
#if QT5_VERSION_MINOR >= 13
border.convertTo(QImage::Format_ARGB32_Premultiplied);
#else
border = border.convertToFormat(QImage::Format_ARGB32_Premultiplied);
#endif
}
//! find shadow size through, plasma theme

Loading…
Cancel
Save