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

List:       kde-commits
Subject:    playground/base/plasma/applets/train-clock
From:       Sebastian Kügler <sebas () kde ! nl>
Date:       2007-12-23 4:41:47
Message-ID: 1198384907.263595.18723.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 751876 by sebas:

Tweak sizing and positioning a bit more

 M  +7 -7      clock.cpp  


--- trunk/playground/base/plasma/applets/train-clock/clock.cpp #751875:751876
@@ -103,7 +103,7 @@
     }
 
     setContentSize(QSize(150, 60));
-    setMinimumContentSize(QSizeF(100, 44));
+    setMinimumContentSize(QSizeF(110, 44));
     dataEngine("time")->connectSource(m_timezone, this, 6000, \
Plasma::AlignToMinute);  }
 
@@ -290,13 +290,12 @@
 int Clock::getOffsetForDigit(const int digitNumber, const int elWidth)
 {
     int offset = 0;
-    const int margin = 4;
+    const int margin = 2;
     if (digitNumber == 0) {
         //return margin;
     }
 
     offset += (elWidth+m_horizontalSpacing) * digitNumber; // Add space taken by \
                digit
-    //offset += (int)(( contentSize().width()-(elWidth*4 + \
                m_horizontalSpacing*6-margin*2)) /2); // Align to center
     offset += (int)(( contentSize().width()-(elWidth*4 + m_horizontalSpacing*4 + \
elWidth/1.7 - margin*2)) /2); // Align to center  
     if (digitNumber > 2) { // There's a smaller gap between hours and minutes ...
@@ -321,7 +320,7 @@
 
         p->setFont (KGlobalSettings::smallestReadableFont());
 
-        const int margin = 4;
+        const int margin = 2;
         const int textMargin = 2;
 
         p->setPen(QPen(QColor("white"))); // FIXME:: Use Plasma color scheme
@@ -344,7 +343,7 @@
             timeRect.setHeight(littlerHeight);   // Resize the timeRect if we have \
to paint some text below.  dateRect.setY(littlerHeight);
             dateRect.setHeight(contentsRect.height());
-            dateRect.setWidth(contentsRect.width());
+            dateRect.setWidth(contentsRect.width()-margin);
         }
 
         // *** At last! At last! Paint!
@@ -410,7 +409,7 @@
 
         m_theme->resize(timeRect.width(), timeRect.height());
 
-        int elHeight = qRound(( timeRect.height() - m_verticalSpacing - margin) / \
2.0); +        int elHeight = qRound(( timeRect.height() - m_verticalSpacing - \
                margin*2) / 2.0);
         int elWidth = qRound(elHeight*1.4); // Needs to be in line with the graphics
 
         m_verticalSpacing = elHeight/11; // From the SVG,the horizontal space is \
1/11 of the height @@ -427,7 +426,8 @@
 
         // set left offset of clock elements so as to horizontally center the time \
display  int leftOffset = getOffsetForDigit(0, elWidth);
-        int upperElementTop =(int)margin;
+        int upperElementTop = (int)margin;
+        //int upperElementTop = 0;
         int bottomElementTop = upperElementTop + elHeight + m_verticalSpacing;
 
         QString show_time;


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

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