On Wednesday 10 June 2009 19:03:35 Aaron J. Seigo wrote:
> On Wednesday 10 June 2009, Petri Damstén wrote:
> > But isn't this too late because plasma sets size before init and it
> > resets the user set size? Is there a proper way to set initial size for
> > scripted applets or should applet just accept the initial size plasma
> > sets.
>
> put X-Plasma-DefaultSize=<some size> in your metadata.desktop file.

Patch to use X-Plasma-DefaultSize in ruby and python examples. ok to commit?

Petri

Index: python/examples/applets/pyclock/metadata.desktop
===================================================================
--- python/examples/applets/pyclock/metadata.desktop	(revision 980109)
+++ python/examples/applets/pyclock/metadata.desktop	(working copy)
@@ -63,6 +63,7 @@
 Icon=chronometer
 X-Plasma-API=python
 X-Plasma-MainScript=code/main.py
+X-Plasma-DefaultSize=125,125
 
 X-KDE-PluginInfo-Author=Simon Edwards
 x-kde-plugininfo-email=si...@simonzone.com
Index: python/examples/applets/pyclock/contents/code/main.py
===================================================================
--- python/examples/applets/pyclock/contents/code/main.py	(revision 980109)
+++ python/examples/applets/pyclock/contents/code/main.py	(working copy)
@@ -50,7 +50,6 @@
         KGlobal.locale().insertCatalog("libplasmaclock")
 
         self.setHasConfigurationInterface(True)
-        self.resize(125, 125)
         self.setAspectRatioMode(Plasma.Square)
 
         self.timezone = ""
Index: ruby/examples/applets/webapplet/metadata.desktop
===================================================================
--- ruby/examples/applets/webapplet/metadata.desktop	(revision 980109)
+++ ruby/examples/applets/webapplet/metadata.desktop	(working copy)
@@ -72,3 +72,4 @@
 X-KDE-PluginInfo-EnabledByDefault=true
 X-Plasma-API=ruby-script
 X-Plasma-MainScript=code/main.rb
+X-Plasma-DefaultSize=600,400
Index: ruby/examples/applets/webapplet/contents/code/main.rb
===================================================================
--- ruby/examples/applets/webapplet/contents/code/main.rb	(revision 980109)
+++ ruby/examples/applets/webapplet/contents/code/main.rb	(working copy)
@@ -41,8 +41,6 @@
   end
 
   def init
-    resize(600, 400)
-
     @page = Plasma::WebView.new(self)
     @page.page = Qt::WebPage.new(@page)
     @page.page.linkDelegationPolicy = Qt::WebPage::DelegateAllLinks
Index: ruby/examples/applets/clock/metadata.desktop
===================================================================
--- ruby/examples/applets/clock/metadata.desktop	(revision 980109)
+++ ruby/examples/applets/clock/metadata.desktop	(working copy)
@@ -124,6 +124,7 @@
 ServiceTypes=Plasma/Applet
 X-Plasma-API=ruby-script
 X-Plasma-MainScript=code/main.rb
+X-Plasma-DefaultSize=125,125
 
 X-KDE-PluginInfo-Author=Richard Dale
 x-kde-plugininfo-email=richard.j.d...@gmail.com
Index: ruby/examples/applets/clock/contents/code/main.rb
===================================================================
--- ruby/examples/applets/clock/contents/code/main.rb	(revision 980109)
+++ ruby/examples/applets/clock/contents/code/main.rb	(working copy)
@@ -40,7 +40,6 @@
     KDE::Global.locale.insertCatalog("libplasmaclock")
 
     setHasConfigurationInterface(true)
-    resize(125, 125)
     setAspectRatioMode(Plasma::Square)
 
     @theme = Plasma::Svg.new(self)

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to