[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/clock
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2007-11-27 22:55:33
Message-ID: 1196204133.679503.30372.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 742394 by aseigo:

don't manage our own geometry


 M  +11 -7     clock.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/clock/clock.cpp #742393:742394
@@ -48,12 +48,17 @@
 
 Clock::Clock(QObject *parent, const QVariantList &args)
     : Plasma::Containment(parent, args),
-      m_dialog(0),
       m_showTimeString(false),
       m_showSecondHand(false),
-      m_timezone("Local")
+      m_timezone("Local"),
+      m_dialog(0)
 {
     setHasConfigurationInterface(true);
+    resize(125, 125);
+
+    m_theme = new Plasma::Svg("widgets/clock", this);
+    m_theme->setContentType(Plasma::Svg::SingleImage);
+    m_theme->resize(size());
 }
 
 void Clock::init()
@@ -61,12 +66,7 @@
     KConfigGroup cg = config();
     m_showTimeString = cg.readEntry("showTimeString", false);
     m_showSecondHand = cg.readEntry("showSecondHand", false);
-    int pixelSize = cg.readEntry("size", 125);
     m_timezone = cg.readEntry("timezone", "Local");
-    m_theme = new Plasma::Svg("widgets/clock", this);
-    m_theme->setContentType(Plasma::Svg::SingleImage);
-    m_theme->resize(pixelSize, pixelSize);
-    setSize(pixelSize, pixelSize);
 
     connectToEngine();
 }
@@ -100,6 +100,10 @@
         }
         updateGeometry();
     }
+
+    if (constraints & Plasma::SizeConstraint) {
+        m_theme->resize(size());
+    }
 }
 
 QPainterPath Clock::shape() const
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic