avoid recursive calls to updateToolTip by doing what we *really* want to be doing here, which is updating the data. this also prevents the case where a tooltip is updated randomly, causing the tooltip to show. i wonder if that's what has been the cause of the occasional taskbar tooltip showing when it shouldn't?
reviewed by Rafał Miłecki svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=794638
This commit is contained in:
parent
30b0cef28a
commit
1f6d6175a7
@ -230,6 +230,13 @@ ToolTip::~ToolTip()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ToolTip::setData(Plasma::Widget *widget, const Plasma::ToolTipData &data)
|
||||||
|
{
|
||||||
|
if (d->currentWidget && d->currentWidget == widget) {
|
||||||
|
setData(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ToolTip::setData(const Plasma::ToolTipData &data)
|
void ToolTip::setData(const Plasma::ToolTipData &data)
|
||||||
{
|
{
|
||||||
//reset our size
|
//reset our size
|
||||||
|
@ -50,6 +50,7 @@ public:
|
|||||||
void hide();
|
void hide();
|
||||||
|
|
||||||
Plasma::Widget *currentWidget() const;
|
Plasma::Widget *currentWidget() const;
|
||||||
|
void setData(Plasma::Widget *widget, const Plasma::ToolTipData &data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent *);
|
void showEvent(QShowEvent *);
|
||||||
|
@ -393,13 +393,13 @@ void Widget::setToolTip(const ToolTipData &tip)
|
|||||||
|
|
||||||
*d->toolTip = tip;
|
*d->toolTip = tip;
|
||||||
|
|
||||||
if (ToolTip::self()->currentWidget() == this) {
|
// this does a check to ensure the current widget is us
|
||||||
ToolTip::self()->show(this);
|
ToolTip::self()->setData(this, *d->toolTip);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::updateToolTip(bool update)
|
void Widget::updateToolTip(bool update)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(update)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void Widget::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user