[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/applets/digital-clock
From: Sebastian Kügler <sebas () kde ! org>
Date: 2008-11-17 2:22:33
Message-ID: 1226888553.010509.8160.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 885320 by sebas:
Scale the subtext font up, correctly align it to the time
The rect used for placing the subtext was a aligned to the left of the
applet, not to the contensRect, so it misaligns as soon as there's a
background set.
BUG:166582
Also made the subtext font scale up a bit, improves usage on very high
dpi displays.
M +11 -5 clock.cpp
--- trunk/KDE/kdebase/workspace/plasma/applets/digital-clock/clock.cpp #885319:885320
@@ -283,16 +283,21 @@
}
// Check sizes
- m_dateRect = preparePainter(p, contentsRect, \
KGlobalSettings::smallestReadableFont(), dateString); + QFont f = \
KGlobalSettings::smallestReadableFont(); + \
f.setPointSizeF(qMax(contentsRect.height()/10, f.pointSize())); +
+ m_dateRect = preparePainter(p, contentsRect, f, dateString);
int subtitleHeight = m_dateRect.height();
- QRectF myRect = QRectF(0,
+ QRectF myRect = QRectF(contentsRect.left(),
contentsRect.bottom()-subtitleHeight,
- contentsRect.right(),
+ contentsRect.width(),
contentsRect.bottom());
+
+ //p->fillRect(myRect, QBrush(QColor("green")));
p->drawText(myRect,
- Qt::AlignHCenter | Qt::TextDontClip,
- dateString
+ Qt::AlignHCenter,
+ dateString.trimmed()
);
// Now find out how much space is left for painting the time
@@ -303,6 +308,7 @@
} else {
timeRect = contentsRect;
}
+ //p->fillRect(timeRect, QBrush(QColor("red")));
QString timeString = KGlobal::locale()->formatTime(m_time, m_showSeconds);
// Choose a relatively big font size to start with
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic