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
Konsole
Commits
fb35320c
Commit
fb35320c
authored
Jul 09, 2020
by
Martin Tobias Holmedahl Sandsmark
Committed by
Tomaz Canabrava
Nov 24, 2021
Browse files
add action to disable/enable mouse tracking
parent
3d641325
Changes
4
Hide whitespace changes
Inline
Side-by-side
desktop/partui.rc
View file @
fb35320c
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui
name=
"konsolepart"
version=
"1
3
"
translationDomain=
"konsole"
>
<gui
name=
"konsolepart"
version=
"1
4
"
translationDomain=
"konsole"
>
<Menu
name=
"session-popup-menu"
>
<Action
name=
"edit_copy_contextmenu"
/>
<Action
name=
"edit_paste"
/>
...
...
@@ -21,6 +21,8 @@
</Menu>
<Separator/>
<Action
name=
"view-readonly"
/>
<Action
name=
"allow-mouse-tracking"
/>
<Separator/>
<Action
name=
"switch-profile"
/>
<Action
name=
"edit-current-profile"
/>
<Action
name=
"manage-profiles"
/>
...
...
desktop/sessionui.rc
View file @
fb35320c
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui
name=
"session"
version=
"
29
"
>
<gui
name=
"session"
version=
"
30
"
>
<MenuBar>
<Menu
name=
"file"
>
<Action
name=
"file_save_as"
group=
"session-operations"
/>
...
...
@@ -32,6 +32,7 @@
<Action
name=
"monitor-process-finish"
group=
"session-view-operations"
/>
<Separator
group=
"session-view-operations"
/>
<Action
name=
"view-readonly"
group=
"session-view-operations"
/>
<Action
name=
"allow-mouse-tracking"
group=
"session-view-operations"
/>
<Separator
group=
"session-view-operations"
/>
<Action
name=
"enlarge-font"
group=
"session-view-operations"
/>
<Action
name=
"reset-font-size"
group=
"session-view-operations"
/>
...
...
@@ -57,6 +58,8 @@
<Action
name=
"adjust-history"
/>
<Separator/>
<Action
name=
"view-readonly"
/>
<Action
name=
"allow-mouse-tracking"
/>
<Separator/>
<Action
name=
"switch-profile"
/>
<Action
name=
"edit-current-profile"
/>
</Menu>
...
...
src/session/SessionController.cpp
View file @
fb35320c
...
...
@@ -560,6 +560,19 @@ void SessionController::toggleReadOnly()
}
}
void
SessionController
::
toggleAllowMouseTracking
()
{
QAction
*
action
=
qobject_cast
<
QAction
*>
(
sender
());
if
(
action
==
nullptr
)
{
// Crash if running in debug build (aka. someone developing)
Q_ASSERT
(
false
&&
"Invalid function called toggleAllowMouseTracking"
);
return
;
}
_view
->
setAllowMouseTracking
(
action
->
isChecked
());
}
void
SessionController
::
removeSearchFilter
()
{
if
(
_searchFilter
==
nullptr
)
{
...
...
@@ -730,6 +743,12 @@ void SessionController::setupCommonActions()
#endif
&
Konsole
::
SessionController
::
changeCodec
);
// Mouse tracking enabled
action
=
collection
->
addAction
(
QStringLiteral
(
"allow-mouse-tracking"
),
this
,
&
SessionController
::
toggleAllowMouseTracking
);
action
->
setText
(
i18nc
(
"@item:inmenu Allows terminal applications to request mouse tracking"
,
"Allow mouse tracking"
));
action
->
setCheckable
(
true
);
action
->
setChecked
(
true
);
// the default state
// Read-only
action
=
collection
->
addAction
(
QStringLiteral
(
"view-readonly"
),
this
,
&
SessionController
::
toggleReadOnly
);
action
->
setText
(
i18nc
(
"@item:inmenu A read only (locked) session"
,
"Read-only"
));
...
...
src/session/SessionController.h
View file @
fb35320c
...
...
@@ -257,6 +257,7 @@ private Q_SLOTS:
void
sendForegroundColor
(
uint
terminator
);
void
sendBackgroundColor
(
uint
terminator
);
void
toggleReadOnly
();
void
toggleAllowMouseTracking
();
// other
void
setupSearchBar
();
...
...
Write
Preview
Markdown
is supported
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