mirror of
https://github.com/KDE/konsole.git
synced 2026-02-05 12:51:44 -05:00
add action to disable/enable mouse tracking
This commit is contained in:
committed by
Tomaz Canabrava
parent
3d64132545
commit
fb35320cdc
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user