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:
Aaron Seigo 2011-12-06 22:42:46 +01:00
parent 0abdaf646d
commit 9d020ded74

View File

@ -140,21 +140,18 @@ void ToolTipManager::show(QGraphicsWidget *widget)
return;
}
qreal delay = 0.0;
ToolTipContent content = d->tooltips[widget];
d->delayedHide = false;
d->hideTimer->stop();
d->showTimer->stop();
const int defaultDelay = Theme::defaultTheme()->toolTipDelay();
if (!content.isInstantPopup()) {
KConfig config("plasmarc");
KConfigGroup cg(&config, "PlasmaToolTips");
delay = cg.readEntry("Delay", qreal(0.7));
if (delay < 0) {
return;
}
if (defaultDelay < 0) {
return;
}
d->hideTimer->stop();
d->delayedHide = false;
d->showTimer->stop();
ToolTipContent content = d->tooltips[widget];
qreal delay = content.isInstantPopup() ? 0.0 : defaultDelay;
d->currentWidget = widget;
if (d->isShown) {
@ -214,6 +211,13 @@ void ToolTipManager::unregisterWidget(QGraphicsWidget *widget)
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);
d->removeWidget(widget);
}
@ -350,14 +354,13 @@ void ToolTipManagerPrivate::clearTips()
void ToolTipManagerPrivate::resetShownState()
{
if (currentWidget) {
if (!tipWidget || !tipWidget->isVisible() || delayedHide) {
//One might have moused out and back in again
delayedHide = false;
isShown = false;
currentWidget = 0;
hideTipWidget();
}
if (!tipWidget || !tipWidget->isVisible() || delayedHide) {
//One might have moused out and back in again
showTimer->stop();
delayedHide = false;
isShown = false;
currentWidget = 0;
hideTipWidget();
}
}