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
55d15632
Commit
55d15632
authored
Feb 12, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Feb 12, 2021
Browse files
Make contextmenu work inside tooltip
parent
f05a0dca
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lsptooltip.cpp
View file @
55d15632
...
...
@@ -227,6 +227,11 @@ public:
break
;
case
QEvent
::
WindowActivate
:
case
QEvent
::
WindowDeactivate
:
case
QEvent
::
FocusOut
:
case
QEvent
::
FocusIn
:
if
(
!
inContextMenu
)
hideTooltip
();
break
;
case
QEvent
::
MouseButtonPress
:
case
QEvent
::
MouseButtonRelease
:
case
QEvent
::
MouseButtonDblClick
:
...
...
@@ -234,6 +239,7 @@ public:
if
(
!
rect
().
contains
(
static_cast
<
QMouseEvent
*>
(
e
)
->
pos
()))
{
hideTooltip
();
}
break
;
default:
break
;
}
...
...
@@ -303,13 +309,14 @@ protected:
void
enterEvent
(
QEvent
*
event
)
override
{
inContextMenu
=
false
;
m_hideTimer
.
stop
();
return
QTextBrowser
::
enterEvent
(
event
);
}
void
leaveEvent
(
QEvent
*
event
)
override
{
if
(
!
m_hideTimer
.
isActive
())
{
if
(
!
m_hideTimer
.
isActive
()
&&
!
inContextMenu
)
{
hideTooltip
();
}
return
QTextBrowser
::
leaveEvent
(
event
);
...
...
@@ -324,7 +331,14 @@ protected:
hideTooltip
();
}
void
contextMenuEvent
(
QContextMenuEvent
*
e
)
override
{
inContextMenu
=
true
;
return
QTextBrowser
::
contextMenuEvent
(
e
);
}
private:
bool
inContextMenu
=
false
;
KTextEditor
::
View
*
m_view
;
QTimer
m_hideTimer
;
HtmlHl
hl
;
...
...
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