diff --git a/svg.cpp b/svg.cpp index 901c913da..e9a42db31 100644 --- a/svg.cpp +++ b/svg.cpp @@ -128,7 +128,7 @@ Svg::Svg( const QString& imagePath, QObject* parent ) : QObject( parent ), d( new Private( imagePath ) ) { - connect( Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeChanged()) ); + connect(Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeChanged())); } Svg::~Svg() @@ -181,7 +181,12 @@ QSize Svg::elementSize(const QString& elementId) qreal dy = d->size.height() / naturalSize.height(); elementSize.scale( elementSize.width() * dx, elementSize.height() * dy, Qt::IgnoreAspectRatio ); - return elementSize.toSize();; + return elementSize.toSize(); +} + +QSize Svg::size() +{ + return d->size.toSize(); } void Svg::themeChanged() diff --git a/svg.h b/svg.h index d37b55072..83283aad0 100644 --- a/svg.h +++ b/svg.h @@ -115,6 +115,13 @@ class PLASMA_EXPORT Svg : public QObject **/ QSize elementSize( const QString& elementId ); + /** + * Currently set size of the SVG + * @arg elementId the id of the element to check + * @return the current size of a given element + **/ + QSize size(); + Q_SIGNALS: void repaintNeeded();