use the global option for tooltips
still has to watch for config file changes
This commit is contained in:
parent
724909d25b
commit
d342c2e186
@ -46,8 +46,14 @@ ToolTip::ToolTip(QQuickItem *parent)
|
||||
showToolTip();
|
||||
});
|
||||
|
||||
setAcceptHoverEvents(true);
|
||||
setFiltersChildMouseEvents(true);
|
||||
KConfig config("plasmarc");
|
||||
KConfigGroup cg(&config, "PlasmaToolTips");
|
||||
|
||||
m_interval = cg.readEntry("Delay", 700);
|
||||
bool enabled = m_interval > 0;
|
||||
|
||||
setAcceptHoverEvents(enabled);
|
||||
setFiltersChildMouseEvents(enabled);
|
||||
}
|
||||
|
||||
ToolTip::~ToolTip()
|
||||
@ -297,7 +303,7 @@ void ToolTip::hoverEnterEvent(QHoverEvent *event)
|
||||
showToolTip();
|
||||
} else if (m_mainItem ||
|
||||
(!mainText().isEmpty() && !subText().isEmpty())) {
|
||||
m_showTimer->start(500);
|
||||
m_showTimer->start(m_interval);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,6 +181,7 @@ private:
|
||||
QVariant m_icon;
|
||||
bool m_active;
|
||||
bool m_interactive;
|
||||
int m_interval;
|
||||
|
||||
//ToolTipDialog is not a Q_GLOBAL_STATIC because QQuickwindows as global static
|
||||
//are deleted too later after some stuff in the qml runtime has already been deleted,
|
||||
|
Loading…
Reference in New Issue
Block a user