From ebfc550c115664abaf794b202e458b7beaae3a4c Mon Sep 17 00:00:00 2001 From: Chani Armitage Date: Sat, 10 Jan 2009 00:33:38 +0000 Subject: [PATCH] a default size for scripted applets, because they aren't allowed to do anything themselves before init (and this is the one thing that *must* be done before init) svn path=/trunk/KDE/kdelibs/; revision=908612 --- applet.cpp | 9 +++++++++ servicetypes/plasma-applet.desktop | 3 +++ 2 files changed, 12 insertions(+) diff --git a/applet.cpp b/applet.cpp index bc1e61f03..cbd260f8e 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1946,6 +1946,15 @@ void AppletPrivate::setupScriptSupport() if (!package->filePath("mainconfigui").isEmpty()) { q->setHasConfigurationInterface(true); } + + //set a default size before any saved settings are read + QSize size = appletDescription.property("X-Plasma-DefaultSize").toSize(); + if (size == QSize()) { + size = QSize(200,200); + } + //kDebug() << "size" << size; + q->resize(size); + } QString AppletPrivate::globalName() const diff --git a/servicetypes/plasma-applet.desktop b/servicetypes/plasma-applet.desktop index a056e93ef..0b02b0f38 100644 --- a/servicetypes/plasma-applet.desktop +++ b/servicetypes/plasma-applet.desktop @@ -59,3 +59,6 @@ Type=QString [PropertyDef::X-Plasma-DropMimeTypes] Type=QStringList +[PropertyDef::X-Plasma-DefaultSize] +Type=QSize +