don't read in plasmarc EVERY time a tooltip is shown, and be careful to stop the show timer always
there are still some issues with QGraphicsView not sending hover events in all cases, but this is as good as it gets if we ignore those bugs in Qt. BUG:247162
This commit is contained in:
parent
0abdaf646d
commit
9d020ded74
@ -140,21 +140,18 @@ void ToolTipManager::show(QGraphicsWidget *widget)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal delay = 0.0;
|
d->delayedHide = false;
|
||||||
ToolTipContent content = d->tooltips[widget];
|
d->hideTimer->stop();
|
||||||
|
d->showTimer->stop();
|
||||||
|
const int defaultDelay = Theme::defaultTheme()->toolTipDelay();
|
||||||
|
|
||||||
if (!content.isInstantPopup()) {
|
if (defaultDelay < 0) {
|
||||||
KConfig config("plasmarc");
|
|
||||||
KConfigGroup cg(&config, "PlasmaToolTips");
|
|
||||||
delay = cg.readEntry("Delay", qreal(0.7));
|
|
||||||
if (delay < 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
d->hideTimer->stop();
|
ToolTipContent content = d->tooltips[widget];
|
||||||
d->delayedHide = false;
|
qreal delay = content.isInstantPopup() ? 0.0 : defaultDelay;
|
||||||
d->showTimer->stop();
|
|
||||||
d->currentWidget = widget;
|
d->currentWidget = widget;
|
||||||
|
|
||||||
if (d->isShown) {
|
if (d->isShown) {
|
||||||
@ -214,6 +211,13 @@ void ToolTipManager::unregisterWidget(QGraphicsWidget *widget)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (widget == d->currentWidget) {
|
||||||
|
d->currentWidget = 0;
|
||||||
|
d->showTimer->stop(); // stop the timer to show the tooltip
|
||||||
|
d->delayedHide = false;
|
||||||
|
d->hideTipWidget();
|
||||||
|
}
|
||||||
|
|
||||||
widget->removeEventFilter(this);
|
widget->removeEventFilter(this);
|
||||||
d->removeWidget(widget);
|
d->removeWidget(widget);
|
||||||
}
|
}
|
||||||
@ -350,15 +354,14 @@ void ToolTipManagerPrivate::clearTips()
|
|||||||
|
|
||||||
void ToolTipManagerPrivate::resetShownState()
|
void ToolTipManagerPrivate::resetShownState()
|
||||||
{
|
{
|
||||||
if (currentWidget) {
|
|
||||||
if (!tipWidget || !tipWidget->isVisible() || delayedHide) {
|
if (!tipWidget || !tipWidget->isVisible() || delayedHide) {
|
||||||
//One might have moused out and back in again
|
//One might have moused out and back in again
|
||||||
|
showTimer->stop();
|
||||||
delayedHide = false;
|
delayedHide = false;
|
||||||
isShown = false;
|
isShown = false;
|
||||||
currentWidget = 0;
|
currentWidget = 0;
|
||||||
hideTipWidget();
|
hideTipWidget();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolTipManagerPrivate::showToolTip()
|
void ToolTipManagerPrivate::showToolTip()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user