From d01cb72c4dd89223eec0f0d8fb70d29c8ae5bb00 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 24 May 2008 15:33:35 +0000 Subject: [PATCH] update the svg painting and margins calculations when the theme changes svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=812089 --- panelsvg.cpp | 13 +++++++++++-- panelsvg.h | 4 +--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/panelsvg.cpp b/panelsvg.cpp index 94c06b6bf..f56e8cb8b 100644 --- a/panelsvg.cpp +++ b/panelsvg.cpp @@ -26,6 +26,8 @@ #include +#include + 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(); } diff --git a/panelsvg.h b/panelsvg.h index fbcae0afb..f696cf269 100644 --- a/panelsvg.h +++ b/panelsvg.h @@ -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