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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/clock
From:       Sebastian Kügler <sebas () kde ! nl>
Date:       2007-07-15 17:44:38
Message-ID: 1184521478.320510.9446.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 688291 by sebas:

Only show seconds in textlabel if the seconds hand is shown.


 M  +17 -6     clock.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/clock/clock.cpp #688290:688291
@@ -202,7 +202,11 @@
         formFactor() == Plasma::Vertical) {
         QString time = m_time.toString();
         QFontMetrics fm(QApplication::font());
-        p->drawText((int)(boundRect.width() * 0.1), (int)(boundRect.height() * \
0.25), m_time.toString()); +        if (m_showSecondHand) {
+            p->drawText((int)(boundRect.width() * 0.1), (int)(boundRect.height() * \
0.25), m_time.toString()); +        } else {
+            p->drawText((int)(boundRect.width() * 0.1), (int)(boundRect.height() * \
0.25), m_time.toString("hh:mm")); +        }
         return;
     }
     m_theme->paint(p, boundRect, "ClockFace");
@@ -251,11 +255,18 @@
     p->restore();
 
     if (m_showTimeString) {
-        //FIXME: temporary time output
-        QString time = m_time.toString();
-        QFontMetrics fm(QApplication::font());
-        p->drawText((int)(boundRect.width()/2 - fm.width(time) / 2),
-                    (int)((boundRect.height()/2) - fm.xHeight()*3), \
m_time.toString()); +        if (m_showSecondHand) {
+            //FIXME: temporary time output
+            QString time = m_time.toString();
+            QFontMetrics fm(QApplication::font());
+            p->drawText((int)(boundRect.width()/2 - fm.width(time) / 2),
+                        (int)((boundRect.height()/2) - fm.xHeight()*3), \
m_time.toString()); +        } else {
+            QString time = m_time.toString("hh:mm");
+            QFontMetrics fm(QApplication::font());
+            p->drawText((int)(boundRect.width()/2 - fm.width(time) / 2),
+                        (int)((boundRect.height()/2) - fm.xHeight()*3), \
m_time.toString("hh:mm")); +        }
     }
 
     m_theme->paint(p, boundRect, "Glass");


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

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