Nicer tooltips:

- No more big font
- Use full width for text label
- Removed gap between main and sub texts

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=759530
This commit is contained in:
Aurélien Gâteau 2008-01-10 20:25:37 +00:00
parent d2a5c1a7af
commit 0d4a6be225

View File

@ -146,6 +146,7 @@ ToolTip::ToolTip()
QGridLayout *l = new QGridLayout; QGridLayout *l = new QGridLayout;
d->preview = new WindowPreview; d->preview = new WindowPreview;
d->label = new QLabel; d->label = new QLabel;
d->label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
d->label->setWordWrap(true); d->label->setWordWrap(true);
d->imageLabel = new QLabel; d->imageLabel = new QLabel;
d->imageLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); d->imageLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
@ -165,8 +166,8 @@ ToolTip::ToolTip()
void ToolTip::setData(const Plasma::ToolTipData &data) void ToolTip::setData(const Plasma::ToolTipData &data)
{ {
d->label->setText("<qt><h3>" + data.mainText + "</h3><p>" + d->label->setText("<qt><b>" + data.mainText + "</b><br>" +
data.subText + "</p></qt>"); data.subText + "</qt>");
d->imageLabel->setPixmap(data.image); d->imageLabel->setPixmap(data.image);
d->windowToPreview = data.windowToPreview; d->windowToPreview = data.windowToPreview;
d->preview->setWindowId( d->windowToPreview ); d->preview->setWindowId( d->windowToPreview );