diff options
| author | Piotr Henryk Dabrowski <[email protected]> | 2019-08-03 15:28:35 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2019-08-03 15:29:26 +0200 |
| commit | ba92917ac2f32e6fa7c8e5c3ecbd6a36b2e79eb0 (patch) | |
| tree | 98a6fb06ef7222b89843721fea686922de22d906 /src/views/dolphinview.cpp | |
| parent | 89239912d842d8b295360994b2c27c305cced30e (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/dolphinview.cpp')
| -rw-r--r-- | src/views/dolphinview.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 5b00fa36d..e6b232dcc 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -128,8 +128,8 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) : m_container = new KItemListContainer(controller, this); m_container->installEventFilter(this); setFocusProxy(m_container); - connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, &DolphinView::hideToolTip); - connect(m_container->verticalScrollBar(), &QScrollBar::valueChanged, this, &DolphinView::hideToolTip); + connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, [=] { hideToolTip(); }); + connect(m_container->verticalScrollBar(), &QScrollBar::valueChanged, this, [=] { hideToolTip(); }); controller->setSelectionBehavior(KItemListController::MultiSelection); connect(controller, &KItemListController::itemActivated, this, &DolphinView::slotItemActivated); @@ -744,6 +744,7 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event) break; case QEvent::KeyPress: + hideToolTip(ToolTipManager::HideBehavior::Instantly); if (GeneralSettings::useTabForSwitchingSplitView()) { QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event); if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) { @@ -1414,11 +1415,11 @@ void DolphinView::updateViewState() } } -void DolphinView::hideToolTip() +void DolphinView::hideToolTip(const ToolTipManager::HideBehavior behavior) { #ifdef HAVE_BALOO if (GeneralSettings::showToolTips()) { - m_toolTipManager->hideToolTip(); + m_toolTipManager->hideToolTip(behavior); } #endif } |
