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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/digital-clock
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2009-04-27 16:52:37
Message-ID: 1240851157.595794.14651.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 959965 by aseigo:

constrain the rect and font size given to the date on tall skinny layouts
BUG:190841


 M  +11 -2     clock.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/digital-clock/clock.cpp #959964:959965
@@ -380,11 +380,20 @@
         // magic 10 is for very big spaces,
         // where there's enough space to grow without harming time space
         QFontMetrics fm(smallFont);
-        smallFont.setPixelSize(qMax(contentsRect.height()/10, fm.ascent()));
         // kDebug(96669) << "=========";
         // kDebug(96669) << "contentsRect: " << contentsRect;
 
-        m_dateRect = preparePainter(p, contentsRect, smallFont, dateString);
+        if (contentsRect.height() > contentsRect.width() * 2) {
+            //kDebug() << Plasma::Vertical << contentsRect.height() <<contentsRect.width() * 2;
+            QRect dateRect = contentsRect;
+            dateRect.setHeight(dateRect.width());
+            smallFont.setPixelSize(qMax(dateRect.height() / 2, fm.ascent()));
+            m_dateRect = preparePainter(p, dateRect, smallFont, dateString);
+        } else {
+            smallFont.setPixelSize(qMax(contentsRect.height()/10, fm.ascent()));
+            m_dateRect = preparePainter(p, contentsRect, smallFont, dateString);
+        }
+
         // kDebug(96669) << "m_dateRect: " << m_dateRect;
 
         int subtitleHeight = m_dateRect.height();
[prev in list] [next in list] [prev in thread] [next in thread] 

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