Commit c49e7262 authored by Aaron J. Seigo's avatar Aaron J. Seigo
Browse files

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
parent 4554bb4c
......@@ -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();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment