Summary: | Gradient: Unit not shown and fonts to big | ||
---|---|---|---|
Product: | [Applications] kalzium | Reporter: | Carsten Niehaus <cniehaus> |
Component: | general | Assignee: | Kalzium Developers <kalzium> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Carsten Niehaus
2005-09-12 19:40:51 UTC
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 ); The part of the bug which can be fixed without adding new strings is done for KDE 3.5, the rest is done in trunk (KDE4). |