Hi, everyone BUG 198888 plasma applet tasks doesn't have an icon on tooltip, because we don't set an icon in TaskGroupItem updateTooltip function. Apply kdebase-plasma-tasks-groupicon.patch to kdebase/workspace/plasma/applets/tasks/ can fix this bug.
BUG 198890 The positions of icon and text on plasma tooltip aren't consistent when grouping or not, because the plasma tooltip only has a QGridLayout. When you enable kwin taskbar thumbnail effect, it cann't work finefor previews, icon and text. So I add previews into a QHBoxLayout, add icon and text into another QHBoxLayout, and set the stretch factor of text is 1, and and both QHBoxLayouts into a QVBoxLayout. These make the items on tooltip looks consistent. kdelibs-tooltip-alignment.patch should be applied to kdelibs/plasma/. Best regards pwp
Index: private/tooltip.cpp =================================================================== --- private/tooltip.cpp (revision 991149) +++ private/tooltip.cpp (working copy) @@ -158,7 +158,6 @@ { setAttribute(Qt::WA_TranslucentBackground); setWindowFlags(Qt::ToolTip); - QGridLayout *l = new QGridLayout; d->preview = new WindowPreview(this); d->text = new TipTextWidget(this); d->imageLabel = new QLabel(this); @@ -171,10 +170,22 @@ connect(d->background, SIGNAL(repaintNeeded()), this, SLOT(updateTheme())); connect(d->preview, SIGNAL(windowPreviewClicked(WId,Qt::MouseButtons,Qt::KeyboardModifiers,QPoint)), this, SIGNAL(activateWindowByWId(WId,Qt::MouseButtons,Qt::KeyboardModifiers,QPoint))); - l->addWidget(d->preview, 0, 0, 1, 2); - l->addWidget(d->imageLabel, 1, 0); - l->addWidget(d->text, 1, 1); - setLayout(l); + + QHBoxLayout *previewHBoxLayout = new QHBoxLayout; + previewHBoxLayout->addWidget(d->preview); + + QHBoxLayout *iconTextHBoxLayout = new QHBoxLayout; + iconTextHBoxLayout->addWidget(d->imageLabel); + iconTextHBoxLayout->setAlignment(d->imageLabel, Qt::AlignCenter); + iconTextHBoxLayout->addWidget(d->text); + iconTextHBoxLayout->setAlignment(d->text, Qt::AlignLeft | Qt::AlignVCenter); + iconTextHBoxLayout->setStretchFactor(d->text, 1); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addLayout(previewHBoxLayout); + mainLayout->addLayout(iconTextHBoxLayout); + + setLayout(mainLayout); } ToolTip::~ToolTip()
Index: taskgroupitem.cpp =================================================================== --- taskgroupitem.cpp (revision 991149) +++ taskgroupitem.cpp (working copy) @@ -254,9 +254,7 @@ Plasma::ToolTipContent data(m_group->name(), i18nc("Which virtual desktop a window is currently on", "On %1", KWindowSystem::desktopName(m_group->desktop()))); -// data.image = m_group->icon().pixmap(QSize::small); -// data.windowToPreview = m_task->window(); - + data.setImage(m_group->icon()); int i = 0; QList<WId> windows;
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel