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

List:       kde-commits
Subject:    playground/base/plasma/applets/train-clock
From:       Riccardo Iaconelli <riccardo () kde ! org>
Date:       2008-01-07 19:33:04
Message-ID: 1199734384.927631.9916.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 758382 by ruphy:

Be less noisy, therefore faster, and a couple of one liners to make the clock \
*really* better (e.g. now the svg is aligned to the grid) Oh, and animate it. =)
Sebas, check this out.

CCMAIL: sebas@kde.org


 M  +7 -7      clock.cpp  


--- trunk/playground/base/plasma/applets/train-clock/clock.cpp #758381:758382
@@ -133,7 +133,6 @@
 
 void Clock::dataUpdated(const QString& source, const Plasma::DataEngine::Data &data)
 {
-    kDebug();
     Q_UNUSED(source);
     m_time = data["Time"].toTime();
     m_date = data["Date"].toDate();
@@ -142,7 +141,7 @@
     // avoid unnecessary repaints
     if (m_time.minute() != m_lastTimeSeen.minute()) {
         m_lastTimeSeen = m_time;
-        update();
+        animateUpdate();
     }
 }
 
@@ -291,7 +290,7 @@
     m_dateRect = QRect(0, 0, 0, 0);
 
     if (m_showDate || m_showTimezone) {
-        kDebug() << "Show Date or Timezone";
+//         kDebug() << "Show Date or Timezone";
         QFontMetrics fm(KGlobalSettings::smallestReadableFont());
 
         int smallerHeight = qRound(m_timeRect.height() - (fm.height() + \
m_margin*3)); @@ -317,8 +316,8 @@
 
 void Clock::animateUpdate()
 {
-    kDebug();
-    QTimeLine *tl = new QTimeLine(100, this);
+//     kDebug();
+    QTimeLine *tl = new QTimeLine(200, this);
     tl->setFrameRange(0, 4);
     //tl->setCurveShape(QTimeLine::EaseInCurve),
     connect(tl, SIGNAL(frameChanged(int)), this, SLOT(animationSlot(int)));
@@ -327,7 +326,7 @@
 
 void Clock::animationSlot(const int step)
 {
-    kDebug();
+//     kDebug();
     if (step == 4) // The animation is stopped
     {
         m_animating = false;
@@ -336,7 +335,7 @@
     } else {
         m_animating = true;
         m_animationStep = step;
-        kDebug() << "step: " + m_animationStep;
+//         kDebug() << "step:" << m_animationStep;
         update();
     }
 }
@@ -376,6 +375,7 @@
         p->setRenderHint(QPainter::SmoothPixmapTransform);
         p->setRenderHint(QPainter::Antialiasing);
         p->setRenderHint(QPainter::TextAntialiasing);
+	p->translate(0.5, 0.5);
 
         // Paint the text
         QString dateString;


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

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