Commit 9d98cabd authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

kateproject: Hide tool-infoview on Esc key press like other bottom toolviews

parent 10760d27
......@@ -26,6 +26,7 @@
#include <QAction>
#include <QDialog>
#include <QHBoxLayout>
#include <QKeyEvent>
#include <QMenu>
#include <QTimer>
#include <QVBoxLayout>
......@@ -139,6 +140,8 @@ KateProjectPluginView::KateProjectPluginView(KateProjectPlugin *plugin, KTextEdi
connect(popup->menu(), &QMenu::aboutToShow, this, &KateProjectPluginView::slotContextMenuAboutToShow);
connect(m_mainWindow, &KTextEditor::MainWindow::unhandledShortcutOverride, this, &KateProjectPluginView::handleEsc);
/**
* add us to gui
*/
......@@ -550,4 +553,18 @@ void KateProjectPluginView::slotContextMenuAboutToShow()
m_gotoSymbolAction->setText(i18n("Goto: %1", squeezed));
}
void KateProjectPluginView::handleEsc(QEvent *e)
{
if (!m_mainWindow) {
return;
}
QKeyEvent *k = static_cast<QKeyEvent *>(e);
if (k->key() == Qt::Key_Escape && k->modifiers() == Qt::NoModifier) {
if (m_toolInfoView->isVisible()) {
m_mainWindow->hideToolView(m_toolInfoView);
}
}
}
#include "kateprojectpluginview.moc"
......@@ -202,6 +202,11 @@ private Q_SLOTS:
*/
void slotContextMenuAboutToShow();
/**
* Handle esc key and hide the toolview
*/
void handleEsc(QEvent *e);
private:
/**
* find current selected or under cursor word
......
Markdown is supported
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