File indexing completed on 2024-04-21 05:30:52

0001 /*
0002     SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #include "panelbackground.h"
0007 
0008 // local
0009 #include "theme.h"
0010 
0011 // Qt
0012 #include <QDebug>
0013 #include <QImage>
0014 #include <QtGlobal>
0015 
0016 #define CENTERWIDTH 100
0017 #define CENTERHEIGHT 50
0018 
0019 #define BASELINESHADOWTHRESHOLD 5
0020 
0021 namespace Latte {
0022 namespace PlasmaExtended {
0023 
0024 PanelBackground::PanelBackground(Plasma::Types::Location edge, Theme *parent)
0025     : QObject(parent),
0026       m_location(edge),
0027       m_parentTheme(parent)
0028 {
0029 }
0030 
0031 PanelBackground::~PanelBackground()
0032 {
0033 }
0034 
0035 bool PanelBackground::hasMask(Plasma::Svg *svg) const
0036 {
0037     if (!svg) {
0038         return false;
0039     }
0040 
0041     return svg->hasElement("mask-topleft");
0042 }
0043 
0044 int PanelBackground::paddingTop() const
0045 {
0046     return m_paddingTop;
0047 }
0048 
0049 int PanelBackground::paddingLeft() const
0050 {
0051     return m_paddingLeft;
0052 }
0053 
0054 int PanelBackground::paddingBottom() const
0055 {
0056     return m_paddingBottom;
0057 }
0058 
0059 int PanelBackground::paddingRight() const
0060 {
0061     return m_paddingRight;
0062 }
0063 
0064 int PanelBackground::roundness() const
0065 {
0066     return m_roundness;
0067 }
0068 
0069 int PanelBackground::shadowSize() const
0070 {
0071     return m_shadowSize;
0072 }
0073 
0074 float PanelBackground::maxOpacity() const
0075 {
0076     return m_maxOpacity;
0077 }
0078 
0079 QColor PanelBackground::shadowColor() const
0080 {
0081     return m_shadowColor;
0082 }
0083 
0084 QString PanelBackground::prefixed(const QString &id)
0085 {
0086     if (m_location == Plasma::Types::TopEdge) {
0087         return QString("north-"+id);
0088     } else if (m_location == Plasma::Types::LeftEdge) {
0089         return QString("west-"+id);
0090     } else if (m_location == Plasma::Types::BottomEdge) {
0091         return QString("south-"+id);
0092     } else if (m_location == Plasma::Types::RightEdge) {
0093         return QString("east-"+id);
0094     }
0095 
0096     return id;
0097 }
0098 
0099 QString PanelBackground::element(Plasma::Svg *svg, const QString &id)
0100 {
0101     if (!svg) {
0102         return "";
0103     }
0104 
0105     if (svg->hasElement(prefixed(id))) {
0106         return prefixed(id);
0107     }
0108 
0109     if (svg->hasElement(id)) {
0110         return id;
0111     }
0112 
0113     return "";
0114 }
0115 
0116 void PanelBackground::updateMaxOpacity(Plasma::Svg *svg)
0117 {
0118     if (!svg) {
0119         return;
0120     }
0121 
0122     QImage center = svg->image(QSize(CENTERWIDTH, CENTERHEIGHT), element(svg, "center"));
0123 
0124     if (center.format() != QImage::Format_ARGB32_Premultiplied) {
0125         center.convertTo(QImage::Format_ARGB32_Premultiplied);
0126     }
0127 
0128     float alphasum{0};
0129 
0130     //! calculating the mid opacity (this is needed in order to handle Oxygen
0131     //! that has different opacity levels in the same center element)
0132     for (int row=0; row<2; ++row) {
0133         QRgb *line = (QRgb *)center.scanLine(row);
0134 
0135         for (int col=0; col<CENTERWIDTH; ++col) {
0136             QRgb pixelData = line[col];
0137             alphasum += ((float)qAlpha(pixelData)/(float)255);
0138         }
0139     }
0140 
0141     m_maxOpacity = alphasum / (float)(2 * CENTERWIDTH);
0142 
0143     //! minimum acceptable panel background opacity is 1%. Such is a case is when
0144     //! panel background is fully transparent but it provides a border. In such case
0145     //! previous approach was identifying as background max opacity 0% and in such case
0146     //! all the upcoming calculations where returning a fully transparent plasma svg to the user
0147     m_maxOpacity = qMax(0.01f, m_maxOpacity);
0148 
0149     emit maxOpacityChanged();
0150 }
0151 
0152 void PanelBackground::updatePaddings(Plasma::Svg *svg)
0153 {
0154     if (!svg) {
0155         return;
0156     }
0157 
0158     m_paddingTop = svg->elementSize(element(svg, "top")).height();
0159     m_paddingLeft = svg->elementSize(element(svg, "left")).width();
0160     m_paddingBottom = svg->elementSize(element(svg, "bottom")).height();
0161     m_paddingRight = svg->elementSize(element(svg, "right")).width();
0162 
0163     emit paddingsChanged();
0164 }
0165 
0166 void PanelBackground::updateRoundnessFromMask(Plasma::Svg *svg)
0167 {
0168     if (!svg) {
0169         return;
0170     }
0171 
0172     bool topLeftCorner = (m_location == Plasma::Types::BottomEdge || m_location == Plasma::Types::RightEdge);
0173 
0174     QString cornerId = (topLeftCorner ? "mask-topleft" : "mask-bottomright");
0175     QImage corner = svg->image(svg->elementSize(cornerId), cornerId);
0176 
0177     if (corner.format() != QImage::Format_ARGB32_Premultiplied) {
0178         corner.convertTo(QImage::Format_ARGB32_Premultiplied);
0179     }
0180 
0181     int baseRow = (topLeftCorner ? corner.height()-1 : 0);
0182     int baseCol = (topLeftCorner ? corner.width()-1 : 0);
0183 
0184     int baseLineLength = 0;
0185     int roundnessLines = 0;
0186 
0187     if (topLeftCorner) {
0188         //! TOPLEFT corner
0189         QRgb *line = (QRgb *)corner.scanLine(baseRow);
0190         QRgb basePoint = line[baseCol];
0191 
0192         QRgb *isRoundedLine = (QRgb *)corner.scanLine(0);
0193         QRgb isRoundedPoint = isRoundedLine[0];
0194 
0195         //! If there is roundness, if that point is not fully transparent then
0196         //! there is no roundness
0197         if (qAlpha(isRoundedPoint) == 0) {
0198 
0199             if (qAlpha(basePoint) > 0) {
0200                 //! calculate the mask baseLine length
0201                 for(int c = baseCol; c>=0; --c) {
0202                     QRgb *l = (QRgb *)corner.scanLine(baseRow);
0203                     QRgb point = line[c];
0204 
0205                     if (qAlpha(point) > 0) {
0206                         baseLineLength ++;
0207                     } else {
0208                         break;
0209                     }
0210                 }
0211             }
0212 
0213             qDebug() << " TOP LEFT CORNER MASK base line length :: " << baseLineLength;
0214 
0215             if (baseLineLength>0) {
0216                 int headLimitR = baseRow;
0217                 int tailLimitR = baseRow;
0218 
0219                 for (int r = baseRow-1; r>=0; --r) {
0220                     QRgb *line = (QRgb *)corner.scanLine(r);
0221                     QRgb fpoint = line[baseCol];
0222                     if (qAlpha(fpoint) == 0) {
0223                         //! a line that is not part of the roundness because its first pixel is fully transparent
0224                         break;
0225                     }
0226 
0227                     headLimitR = r;
0228                 }
0229 
0230                 int c = qMax(0, corner.width() - baseLineLength);
0231 
0232                 for (int r = baseRow-1; r>=0; --r) {
0233                     QRgb *line = (QRgb *)corner.scanLine(r);
0234                     QRgb point = line[c];
0235 
0236                     if (qAlpha(point) != 255) {
0237                         tailLimitR = r;
0238                         break;
0239                     }
0240                 }
0241 
0242                 //qDebug() << "   -> calculations: " << ", tail row :" <<  tailLimitR << " | head row: " << headLimitR;
0243 
0244                 if (headLimitR != tailLimitR) {
0245                     roundnessLines = tailLimitR - headLimitR + 1;
0246                 }
0247             }
0248         }
0249     } else {
0250         //! BOTTOMRIGHT CORNER
0251         //! it should be TOPRIGHT corner in that case
0252         QRgb *line = (QRgb *)corner.scanLine(baseRow);
0253         QRgb basePoint = line[baseCol];
0254 
0255         QRgb *isRoundedLine = (QRgb *)corner.scanLine(corner.height()-1);
0256         QRgb isRoundedPoint = isRoundedLine[corner.width()-1];
0257 
0258         //! If there is roundness, if that point is not fully transparent then
0259         //! there is no roundness
0260         if (qAlpha(isRoundedPoint) == 0) {
0261 
0262             if (qAlpha(basePoint) > 0) {
0263                 //! calculate the mask baseLine length
0264                 for(int c = baseCol; c<corner.width(); ++c) {
0265                     QRgb *l = (QRgb *)corner.scanLine(baseRow);
0266                     QRgb point = line[c];
0267 
0268                     if (qAlpha(point) > 0) {
0269                         baseLineLength ++;
0270                     } else {
0271                         break;
0272                     }
0273                 }
0274             }
0275 
0276             qDebug() << " BOTTOM RIGHT CORNER MASK base line length :: " << baseLineLength;
0277 
0278             if (baseLineLength>0) {
0279                 int headLimitR = 0;
0280                 int tailLimitR = 0;
0281 
0282                 for (int r = baseRow+1; r<=corner.height(); ++r) {
0283                     QRgb *line = (QRgb *)corner.scanLine(r);
0284                     QRgb fpoint = line[baseCol];
0285                     if (qAlpha(fpoint) == 0) {
0286                         //! a line that is not part of the roundness because its first pixel is not trasparent
0287                         break;
0288                     }
0289 
0290                     headLimitR = r;
0291                 }
0292 
0293                 int c = baseLineLength - 1;
0294 
0295                 for (int r = baseRow+1; r<=corner.height(); ++r) {
0296                     QRgb *line = (QRgb *)corner.scanLine(r);
0297                     QRgb point = line[c];
0298 
0299                     if (qAlpha(point) != 255) {
0300                         tailLimitR = r;
0301                         break;
0302                     }
0303                 }
0304 
0305                 //qDebug() << "   -> calculations: " << ", tail row :" <<  tailLimitR << " | head row: " << headLimitR;
0306 
0307                 if (headLimitR != tailLimitR) {
0308                     roundnessLines = headLimitR - tailLimitR + 1;
0309                 }
0310             }
0311         }
0312     }
0313 
0314     m_roundness = roundnessLines;
0315     emit roundnessChanged();
0316 }
0317 
0318 
0319 
0320 void PanelBackground::updateRoundnessFromShadows(Plasma::Svg *svg)
0321 {
0322     //! 1.  Algorithm is choosing which corner shadow based on panel location
0323     //! 2.  For that corner discovers the maxOpacity (most solid shadow point) and
0324     //!     how pixels (distance) is to the most solid point, that is called [baseLineLength]
0325     //! 3.  After [2] the algorigthm for each next line calculates the maxOpacity
0326     //!     for that line and how many points are needed to reach there. If the points
0327     //!     to reach the line max opacity are shorter than baseLineLength then that line
0328     //!     is considered part of the roundness
0329     //! 3.1 Avoid zig-zag cases such as the Air plasma theme case. When the shadow is not
0330     //!     following a straight line until reaching the rounded part the algorithm is
0331     //!     considering as valid roundness only the last part of the discovered roundness and
0332     //!     ignores all the previous.
0333     //! 4.  Calculating the lines that are shorter than the baseline provides
0334     //!     the discovered roundness
0335 
0336     if (!svg) {
0337         return;
0338     }
0339 
0340     bool topLeftCorner = (m_location == Plasma::Types::BottomEdge || m_location == Plasma::Types::RightEdge);
0341 
0342     QString cornerId = (topLeftCorner ? "shadow-topleft" : "shadow-bottomright");
0343     QImage corner = svg->image(svg->elementSize(cornerId), cornerId);
0344 
0345     if (corner.format() != QImage::Format_ARGB32_Premultiplied) {
0346         corner.convertTo(QImage::Format_ARGB32_Premultiplied);
0347     }
0348 
0349     int baseRow = (topLeftCorner ? corner.height()-1 : 0);
0350     int baseCol = (topLeftCorner ? corner.width()-1 : 0);
0351 
0352     int baseLineLength = 0;
0353     int roundnessLines = 0;
0354 
0355     if (topLeftCorner) {
0356         //! TOPLEFT corner
0357         QRgb *line = (QRgb *)corner.scanLine(baseRow);
0358         QRgb basePoint = line[baseCol];
0359 
0360         int baseShadowMaxOpacity = 0;
0361 
0362         if (qAlpha(basePoint) == 0) {
0363             //! calculate the shadow maxOpacity in the base line
0364             //! and number of pixels to reach there
0365             for(int c = baseCol; c>=0; --c) {
0366                 QRgb *l = (QRgb *)corner.scanLine(baseRow);
0367                 QRgb point = line[c];
0368 
0369                 if (qAlpha(point) > baseShadowMaxOpacity) {
0370                     baseShadowMaxOpacity = qAlpha(point);
0371                     baseLineLength = (baseCol - c + 1);
0372                 }
0373             }
0374         }
0375 
0376         qDebug() << " TOP LEFT CORNER SHADOW base line length :: " << baseLineLength << " with max shadow opacity : " << baseShadowMaxOpacity;
0377 
0378         if (baseLineLength>0) {
0379             for (int r = baseRow-1; r>=0; --r) {
0380                 QRgb *line = (QRgb *)corner.scanLine(r);
0381                 QRgb fpoint = line[baseCol];
0382                 if (qAlpha(fpoint) != 0) {
0383                     //! a line that is not part of the roundness because its first pixel is not trasparent
0384                     break;
0385                 }
0386 
0387                 int transPixels = 0;
0388                 int rowMaxOpacity = 0;
0389 
0390                 for(int c = baseCol; c>=0; --c) {
0391                     QRgb *l = (QRgb *)corner.scanLine(r);
0392                     QRgb point = line[c];
0393 
0394                     if (qAlpha(point) > rowMaxOpacity) {
0395                         rowMaxOpacity = qAlpha(point);
0396                         continue;
0397                     }
0398                 }
0399 
0400                 for(int c = baseCol; c>=(baseCol - baseLineLength + 1); --c) {
0401                     QRgb *l = (QRgb *)corner.scanLine(r);
0402                     QRgb point = line[c];
0403 
0404                     if (qAlpha(point) != rowMaxOpacity) {
0405                         transPixels++;
0406                         continue;
0407                     }
0408 
0409                     if (transPixels != baseLineLength) {
0410                         roundnessLines++;
0411                         break;
0412                     }
0413                 }
0414 
0415                 if (transPixels == baseLineLength) {
0416                     //! 3.1 avoid zig-zag shadows Air plasma theme case
0417                     roundnessLines = 0;
0418                 }
0419 
0420                 //qDebug() << "    -> line: " << r << ", low transparency pixels :" << transPixels << " | " << " rowMaxOpacity :"<< rowMaxOpacity << ", " << (transPixels != baseLineLength);
0421             }
0422         }
0423     } else {
0424         //! BOTTOMRIGHT CORNER
0425         //! it should be TOPRIGHT corner in that case
0426         QRgb *line = (QRgb *)corner.scanLine(baseRow);
0427         QRgb basePoint = line[baseCol];
0428 
0429         int baseShadowMaxOpacity = 0;
0430 
0431         if (qAlpha(basePoint) == 0) {
0432             //! calculate the base line transparent pixels
0433             for(int c = baseCol; c<corner.width(); ++c) {
0434                 QRgb *l = (QRgb *)corner.scanLine(baseRow);
0435                 QRgb point = line[c];
0436 
0437                 if (qAlpha(point) > baseShadowMaxOpacity) {
0438                     baseShadowMaxOpacity = qAlpha(point);
0439                     baseLineLength = c + 1;
0440                 }
0441             }
0442         }
0443 
0444         qDebug() << " BOTTOM RIGHT CORNER SHADOW base line length :: " << baseLineLength << " with max shadow opacity : " << baseShadowMaxOpacity;
0445 
0446         if (baseLineLength>0) {
0447             for (int r = baseRow+1; r<=corner.height(); ++r) {
0448                 QRgb *line = (QRgb *)corner.scanLine(r);
0449                 QRgb fpoint = line[baseCol];
0450                 if (qAlpha(fpoint) != 0) {
0451                     //! a line that is not part of the roundness because its first pixel is not trasparent
0452                     break;
0453                 }
0454 
0455                 int transPixels = 0;
0456                 int rowMaxOpacity = 0;
0457 
0458                 for(int c = baseCol; c<corner.width(); ++c) {
0459                     QRgb *l = (QRgb *)corner.scanLine(r);
0460                     QRgb point = line[c];
0461 
0462                     if (qAlpha(point) > rowMaxOpacity) {
0463                         rowMaxOpacity = qAlpha(point);
0464                         baseLineLength = c + 1;
0465                     }
0466                 }
0467 
0468                 for(int c = baseCol; c<baseLineLength; ++c) {
0469                     QRgb *l = (QRgb *)corner.scanLine(r);
0470                     QRgb point = line[c];
0471 
0472                     if (qAlpha(point) != rowMaxOpacity) {
0473                         transPixels++;
0474                         continue;
0475                     }
0476 
0477                     if (transPixels != baseLineLength) {
0478                         roundnessLines++;
0479                         break;
0480                     }
0481                 }
0482 
0483                 if (transPixels == baseLineLength) {
0484                     //! 3.1 avoid zig-zag shadows Air plasma theme case
0485                     roundnessLines = 0;
0486                 }
0487 
0488                 //qDebug() << "    -> line: " << r << ", low transparency pixels :" << transPixels << " | " << " rowMaxOpacity :"<< rowMaxOpacity << ", " << (transPixels != baseLineLength);
0489             }
0490         }
0491     }
0492 
0493     m_roundness = roundnessLines;
0494     emit roundnessChanged();
0495 }
0496 
0497 void PanelBackground::updateRoundnessFallback(Plasma::Svg *svg)
0498 {
0499     if (!svg) {
0500         return;
0501     }
0502 
0503     QString cornerId = element(svg, (m_location == Plasma::Types::LeftEdge ? "bottomright" : "topleft"));
0504     QImage corner = svg->image(svg->elementSize(cornerId), cornerId);
0505 
0506     if (corner.format() != QImage::Format_ARGB32_Premultiplied) {
0507         corner.convertTo(QImage::Format_ARGB32_Premultiplied);
0508     }
0509 
0510     int discovRow = (m_location == Plasma::Types::LeftEdge ? corner.height()-1 : 0);
0511     int discovCol{0};
0512     //int discovCol = (m_location == Plasma::Types::LeftEdge ? corner.width()-1 : 0);
0513     int round{0};
0514 
0515     int minOpacity = m_maxOpacity * 255;
0516 
0517     if (m_location == Plasma::Types::BottomEdge || m_location == Plasma::Types::RightEdge || m_location == Plasma::Types::TopEdge) {
0518         //! TOPLEFT corner
0519         //! first LEFT pixel found
0520         QRgb *line = (QRgb *)corner.scanLine(discovRow);
0521 
0522         for (int col=0; col<corner.width() - 1; ++col) {
0523             QRgb pixelData = line[col];
0524 
0525             if (qAlpha(pixelData) < minOpacity) {
0526                 discovCol++;
0527                 round++;
0528             } else {
0529                 break;
0530             }
0531         }
0532     } else if (m_location == Plasma::Types::LeftEdge) {
0533         //! it should be TOPRIGHT corner in that case
0534         //! first RIGHT pixel found
0535         QRgb *line = (QRgb *)corner.scanLine(discovRow);
0536         for (int col=corner.width()-1; col>0; --col) {
0537             QRgb pixelData = line[col];
0538 
0539             if (qAlpha(pixelData) < minOpacity) {
0540                 discovCol--;
0541                 round++;
0542             } else {
0543                 break;
0544             }
0545         }
0546     }
0547 
0548     m_roundness = round;
0549     emit roundnessChanged();
0550 }
0551 
0552 void PanelBackground::updateShadow(Plasma::Svg *svg)
0553 {
0554     if (!svg) {
0555         return;
0556     }
0557 
0558     if (!m_parentTheme->hasShadow()) {
0559         m_shadowSize = 0;
0560         m_shadowColor = Qt::black;
0561         return;
0562     }
0563 
0564     bool horizontal = (m_location == Plasma::Types::BottomEdge || m_location == Plasma::Types::TopEdge);
0565 
0566     QString borderId{"shadow-top"};
0567 
0568     if  (m_location == Plasma::Types::TopEdge) {
0569         borderId = "shadow-bottom";
0570     } else if (m_location == Plasma::Types::LeftEdge) {
0571         borderId = "shadow-right";
0572     } else if (m_location == Plasma::Types::RightEdge) {
0573         borderId = "shadow-left";
0574     }
0575 
0576     QImage border = svg->image(svg->elementSize(borderId), borderId);
0577 
0578     if (border.format() != QImage::Format_ARGB32_Premultiplied) {
0579         border.convertTo(QImage::Format_ARGB32_Premultiplied);
0580     }
0581 
0582     //! find shadow size through, plasma theme
0583     int themeshadowsize{0};
0584 
0585     if  (m_location == Plasma::Types::TopEdge) {
0586         themeshadowsize = svg->elementSize(element(svg, "shadow-hint-bottom-margin")).height();
0587     } else if (m_location == Plasma::Types::LeftEdge) {
0588         themeshadowsize = svg->elementSize(element(svg, "shadow-hint-right-margin")).width();
0589     } else if (m_location == Plasma::Types::RightEdge) {
0590         themeshadowsize = svg->elementSize(element(svg, "shadow-hint-left-margin")).width();
0591     } else {
0592         themeshadowsize = svg->elementSize(element(svg, "shadow-hint-top-margin")).height();
0593     }
0594 
0595     //! find shadow size through heuristics, elementsize provided through svg may not be valid because it could contain
0596     //! many fully transparent pixels in its edges
0597     int discoveredshadowsize{0};
0598     int firstPixel{-1};
0599     int lastPixel{-1};
0600 
0601     if (horizontal) {
0602         for(int y = 0; y<border.height(); ++y) {
0603             QRgb *line = (QRgb *)border.scanLine(y);
0604             QRgb pixel = line[0];
0605 
0606             if (qAlpha(pixel) > 0) {
0607                 if (firstPixel < 0) {
0608                     firstPixel = y;
0609                     lastPixel = y;
0610                 } else {
0611                     lastPixel = y;
0612                 }
0613             }
0614         }
0615     } else {
0616         QRgb *line = (QRgb *)border.scanLine(0);
0617         for(int x = 0; x<border.width(); ++x) {
0618             QRgb pixel = line[x];
0619 
0620             if (qAlpha(pixel) > 0) {
0621                 if (firstPixel < 0) {
0622                     firstPixel = x;
0623                     lastPixel = x;
0624                 } else {
0625                     lastPixel = x;
0626                 }
0627             }
0628         }
0629     }
0630 
0631     discoveredshadowsize = (firstPixel>=0 ? qMax(0, lastPixel - firstPixel + 1) : 0);
0632 
0633     m_shadowSize = qMax(themeshadowsize, discoveredshadowsize);
0634 
0635     //! find maximum shadow color applied
0636     int maxopacity{0};
0637 
0638     for (int r=0; r<border.height(); ++r) {
0639         QRgb *line = (QRgb *)border.scanLine(r);
0640 
0641         for(int c = 0; c<border.width(); ++c) {
0642             QRgb pixel = line[c];
0643 
0644             if (qAlpha(pixel) > maxopacity) {
0645                 maxopacity = qAlpha(pixel);
0646                 m_shadowColor = QColor(pixel);
0647                 m_shadowColor.setAlpha(qMin(255, maxopacity));
0648             }
0649         }
0650     }
0651 }
0652 
0653 
0654 void PanelBackground::updateRoundness(Plasma::Svg *svg)
0655 {
0656     if (!svg) {
0657         return;
0658     }
0659 
0660     if (hasMask(svg)) {
0661         qDebug() << "PLASMA THEME, calculating roundness from mask...";
0662         updateRoundnessFromMask(svg);
0663     } else if (m_parentTheme->hasShadow()) {
0664         qDebug() << "PLASMA THEME, calculating roundness from shadows...";
0665         updateRoundnessFromShadows(svg);
0666     } else {
0667         qDebug() << "PLASMA THEME, calculating roundness from fallback code...";
0668         updateRoundnessFallback(svg);
0669     }
0670 }
0671 
0672 void PanelBackground::update()
0673 {
0674     Plasma::Svg *backSvg = new Plasma::Svg(this);
0675     backSvg->setImagePath(QStringLiteral("widgets/panel-background"));
0676     backSvg->resize();
0677 
0678     updateMaxOpacity(backSvg);
0679     updatePaddings(backSvg);
0680     updateRoundness(backSvg);
0681     updateShadow(backSvg);
0682 
0683     qDebug() << " PLASMA THEME EXTENDED :: " << m_location << " | roundness:" << m_roundness << " center_max_opacity:" << m_maxOpacity;
0684     qDebug() << " PLASMA THEME EXTENDED :: " << m_location
0685              << " | padtop:" << m_paddingTop << " padleft:" << m_paddingLeft
0686              << " padbottom:" << m_paddingBottom << " padright:" << m_paddingRight;
0687     qDebug() << " PLASMA THEME EXTENDED :: " << m_location << " | shadowsize:" << m_shadowSize << " shadowcolor:" << m_shadowColor;
0688 
0689     backSvg->deleteLater();
0690 }
0691 
0692 }
0693 }