fix for the billionth time the tooltip positioning borkage, hopefully

this way is a bit more robust

svn path=/trunk/KDE/kdelibs/; revision=955449
This commit is contained in:
Marco Martin 2009-04-17 16:55:42 +00:00
parent 86c869be37
commit 3075eb4bd6
2 changed files with 11 additions and 15 deletions

View File

@ -185,24 +185,15 @@ void ToolTip::checkSize()
d->text->setMinimumSize(d->text->minimumSizeHint());
d->text->setMaximumSize(d->text->maximumSizeHint());
QSize previous = size();
const QSize previous = size();
adjustSize();
QSize current = size();
const QSize current = size();
}
void ToolTip::adjustPosition(const QSize &previous, const QSize &current)
{
if (previous != current) {
/*
#ifdef Q_WS_X11
NETRootInfo i(QX11Info::display(), 0);
int flags = NET::BottomLeft;
i.moveResizeWindowRequest(winId(), flags,
x(), y() + (current.height() - hint.height()),
hint.width(), hint.height());
#else
move(x(), y() + (current.height() - hint.height()));
resize(hint);
#endif
*/
//offsets to stop tooltips from jumping when they resize
int deltaX = 0;
int deltaY = 0;
@ -312,6 +303,10 @@ void ToolTip::resizeEvent(QResizeEvent *e)
d->background->resizeFrame(size());
setMask(d->background->mask());
d->preview->setInfo();
if (isVisible()) {
adjustPosition(e->oldSize(), e->size());
}
}
void ToolTip::paintEvent(QPaintEvent *e)

View File

@ -45,6 +45,7 @@ public:
protected:
void checkSize();
void adjustPosition(const QSize &previous, const QSize &current);
void showEvent(QShowEvent *);
void hideEvent(QHideEvent *);
void mouseReleaseEvent(QMouseEvent *);