Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
9d98cabd
Commit
9d98cabd
authored
Feb 09, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Feb 09, 2021
Browse files
kateproject: Hide tool-infoview on Esc key press like other bottom toolviews
parent
10760d27
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/project/kateprojectpluginview.cpp
View file @
9d98cabd
...
...
@@ -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"
addons/project/kateprojectpluginview.h
View file @
9d98cabd
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment