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:
parent
86c869be37
commit
3075eb4bd6
@ -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 ¤t)
|
||||
{
|
||||
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)
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
|
||||
protected:
|
||||
void checkSize();
|
||||
void adjustPosition(const QSize &previous, const QSize ¤t);
|
||||
void showEvent(QShowEvent *);
|
||||
void hideEvent(QHideEvent *);
|
||||
void mouseReleaseEvent(QMouseEvent *);
|
||||
|
Loading…
Reference in New Issue
Block a user