update the svg painting and margins calculations when the theme changes
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=812089
This commit is contained in:
parent
a2fb80dd0e
commit
d01cb72c4d
13
panelsvg.cpp
13
panelsvg.cpp
@ -26,6 +26,8 @@
|
||||
|
||||
#include <KDebug>
|
||||
|
||||
#include <plasma/theme.h>
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
@ -88,6 +90,7 @@ public:
|
||||
|
||||
void generateBackground(PanelData *panel);
|
||||
void updateSizes();
|
||||
void updateNeeded();
|
||||
void updateAndSignalSizes();
|
||||
|
||||
Location location;
|
||||
@ -104,7 +107,7 @@ PanelSvg::PanelSvg(QObject* parent)
|
||||
: Svg(parent),
|
||||
d(new Private(this))
|
||||
{
|
||||
connect(this, SIGNAL(repaintNeeded()), this, SLOT(updateSizes()));
|
||||
connect(this, SIGNAL(repaintNeeded()), this, SLOT(updateNeeded()));
|
||||
d->panels.insert(QString(), new PanelData());
|
||||
}
|
||||
|
||||
@ -602,9 +605,15 @@ void PanelSvg::Private::updateSizes()
|
||||
panel->stretchBorders = q->hasElement("hint-stretch-borders");
|
||||
}
|
||||
|
||||
void PanelSvg::Private::updateNeeded()
|
||||
{
|
||||
q->clearCache();
|
||||
updateSizes();
|
||||
}
|
||||
|
||||
void PanelSvg::Private::updateAndSignalSizes()
|
||||
{
|
||||
// updateSizes(); <-- this gets called when repaintNeeded is emitted
|
||||
updateSizes();
|
||||
emit q->repaintNeeded();
|
||||
}
|
||||
|
||||
|
@ -193,14 +193,12 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
||||
*/
|
||||
Q_INVOKABLE void paintPanel(QPainter* painter, const QRectF& rect, const QPointF& pos = QPointF(0, 0));
|
||||
|
||||
Q_SIGNALS:
|
||||
void repaintNeeded();
|
||||
|
||||
private:
|
||||
class Private;
|
||||
Private * const d;
|
||||
|
||||
Q_PRIVATE_SLOT(d, void updateSizes())
|
||||
Q_PRIVATE_SLOT(d, void updateNeeded())
|
||||
};
|
||||
|
||||
} // Plasma namespace
|
||||
|
Loading…
Reference in New Issue
Block a user