mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
* Using QPixmap instead of QBitmap for painting the text allows us to have anti aliased
fonts. * Adjusted sizeTip, so the text isn't scaled anymore and looks better now. svn path=/trunk/KDE/kdebase/apps/; revision=795569
This commit is contained in:
parent
71b626b358
commit
80f345e165
1 changed files with 4 additions and 4 deletions
|
@ -28,7 +28,7 @@ QSize KFormattedBalloonTipDelegate::sizeHint(const KStyleOptionToolTip *option,
|
|||
doc.setHtml(item->text());
|
||||
QIcon icon = item->icon();
|
||||
QSize is = (icon.isNull()) ? QSize(0,0) : QSize(icon.actualSize(option->decorationSize).width(),0);
|
||||
return doc.size().toSize()+is+QSize(20,20);
|
||||
return doc.size().toSize()+is+QSize(20+5,20+1);
|
||||
}
|
||||
|
||||
void KFormattedBalloonTipDelegate::paint(QPainter *painter, const KStyleOptionToolTip *option, const KToolTipItem *item) const
|
||||
|
@ -58,12 +58,12 @@ void KFormattedBalloonTipDelegate::paint(QPainter *painter, const KStyleOptionTo
|
|||
|
||||
QTextDocument doc;
|
||||
doc.setHtml(item->text());
|
||||
QBitmap bitmap(doc.size().toSize());
|
||||
bitmap.fill(Qt::color0);
|
||||
QPixmap bitmap(doc.size().toSize());
|
||||
bitmap.fill(Qt::transparent);
|
||||
QPainter p(&bitmap);
|
||||
doc.drawContents(&p);
|
||||
|
||||
painter->drawPixmap(contents, bitmap, QRect(QPoint(0,0), bitmap.size()));
|
||||
painter->drawPixmap(contents, bitmap);
|
||||
}
|
||||
|
||||
QRegion KFormattedBalloonTipDelegate::inputShape(const KStyleOptionToolTip *option) const
|
||||
|
|
Loading…
Reference in a new issue