[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdeedu/kalzium/src
From: Carsten Niehaus <cniehaus () gmx ! de>
Date: 2005-09-15 9:48:11
Message-ID: 1126777691.430402.26372.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 460807 by cniehaus:
Part one of this bug: Fix the size of the font
CCBUG: 112492
M +16 -0 periodictableview.cpp
--- branches/KDE/3.5/kdeedu/kalzium/src/periodictableview.cpp #460806:460807
@@ -983,6 +983,7 @@
EList::ConstIterator it = d->ElementList.begin();
const EList::ConstIterator itEnd = d->ElementList.end();
+
/**
* this loop iterates through all elements. The Elements
* draw themselves, the PerodicTableView only tells them to do so
@@ -1105,6 +1106,21 @@
QImage img = KImageEffect::gradient ( s, Qt::white, Qt::red,
KImageEffect::HorizontalGradient );
QPixmap pm( img );
+
+ /**
+ * now find the optimum stringsize for the caption
+ * i18n( "Gradient: van der Waals Radius" ); is at least
+ * for english the longest possible string. As "van der Waals"
+ * is a name it should be the same in all languages and be
+ * probably always the longest string
+ */
+ QString tmp = i18n( "Gradient: van der Waals Radius" );
+ QRect rect(x+5, y+50, ELEMENTSIZE*10,20);
+ QFont font = p->font();
+ int maxSize = KalziumUtils::maxSize( tmp, rect, p->font(), p, 8, 24 );
+ kdDebug() << "maxSize: " << maxSize << endl;
+ font.setPointSize(maxSize);
+ p->setFont(font);
p->drawText( x+5, y+50, ELEMENTSIZE*10,20, Qt::AlignCenter, title );
p->drawPixmap( x+50, y+80, pm );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic