┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/tooltips/tooltipmanager.cpp
diff options
context:
space:
mode:
authorPiotr Henryk Dabrowski <[email protected]>2019-08-03 15:28:35 +0200
committerElvis Angelaccio <[email protected]>2019-08-03 15:29:26 +0200
commitba92917ac2f32e6fa7c8e5c3ecbd6a36b2e79eb0 (patch)
tree98a6fb06ef7222b89843721fea686922de22d906 /src/views/tooltips/tooltipmanager.cpp
parent89239912d842d8b295360994b2c27c305cced30e (diff)
[Dolphin] Hide tooltip instantly on key press
Summary: Instantly hide tooltip shown over an element when a key is pressed. Currently, when pressing an alphanum key to select a different file, the tooltip continues to cover much of the window - often hiding that newly selected file from view. Reviewers: #dolphin, ngraham, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: broulik, elvisangelaccio, kfm-devel, pdabrowski Tags: #dolphin Differential Revision: https://phabricator.kde.org/D22512
Diffstat (limited to 'src/views/tooltips/tooltipmanager.cpp')
-rw-r--r--src/views/tooltips/tooltipmanager.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/views/tooltips/tooltipmanager.cpp b/src/views/tooltips/tooltipmanager.cpp
index aae97458c..eaa785987 100644
--- a/src/views/tooltips/tooltipmanager.cpp
+++ b/src/views/tooltips/tooltipmanager.cpp
@@ -104,7 +104,7 @@ void ToolTipManager::showToolTip(const KFileItem& item, const QRectF& itemRect,
Q_ASSERT(!m_metaDataRequested);
}
-void ToolTipManager::hideToolTip()
+void ToolTipManager::hideToolTip(const HideBehavior behavior)
{
if (m_appliedWaitCursor) {
QApplication::restoreOverrideCursor();
@@ -116,7 +116,14 @@ void ToolTipManager::hideToolTip()
m_showToolTipTimer->stop();
m_contentRetrievalTimer->stop();
if (m_tooltipWidget) {
- m_tooltipWidget->hideLater();
+ switch (behavior) {
+ case HideBehavior::Instantly:
+ m_tooltipWidget->hide();
+ break;
+ case HideBehavior::Later:
+ m_tooltipWidget->hideLater();
+ break;
+ }
}
}