┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/terminal/terminalpanel.cpp
diff options
context:
space:
mode:
authorNate Graham <[email protected]>2019-03-20 23:06:28 +0100
committerNate Graham <[email protected]>2019-12-05 15:53:19 -0700
commit69838a1cdd6a10d9d6ca6572962c438a97d46b36 (patch)
tree83b3d3f5347faf92e52ed5770108055df6b3bc9e /src/panels/terminal/terminalpanel.cpp
parent8b0c12a59ccb23fdb6393f640693d21afaeb02a1 (diff)
Add action for focusing Terminal Panel
Summary: Add an action for focusing and de-focusing the Terminal Panel. FEATURE: 185096 FIXED-IN 20.04.0 Test Plan: - Hit {key Ctrl Shift F4} or click {nav Tools > Focus Terminal Panel} or {nav Control > Tools > Focus Terminal Panel} - If the Terminal Panel was closed, it opens and gains focus - If the Terminal Panel was open but unfocused, it gains focus - If the Terminal Panel was open and focused, focus returns to the view {F6630289, size=full} Reviewers: #dolphin, elvisangelaccio, rominf Reviewed By: #dolphin, elvisangelaccio, rominf Subscribers: kfm-devel, elvisangelaccio, rkflx, ngraham, #dolphin Tags: #dolphin Differential Revision: https://phabricator.kde.org/D10959
Diffstat (limited to 'src/panels/terminal/terminalpanel.cpp')
-rw-r--r--src/panels/terminal/terminalpanel.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp
index 86974d200..861afebee 100644
--- a/src/panels/terminal/terminalpanel.cpp
+++ b/src/panels/terminal/terminalpanel.cpp
@@ -147,6 +147,7 @@ void TerminalPanel::showEvent(QShowEvent* event)
if (m_konsolePart) {
connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited);
m_terminalWidget = m_konsolePart->widget();
+ setFocusProxy(m_terminalWidget);
m_layout->addWidget(m_terminalWidget);
if (m_konsolePartMissingMessage) {
m_layout->removeWidget(m_konsolePartMissingMessage);
@@ -263,3 +264,8 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir)
const QUrl url(QUrl::fromLocalFile(dir));
emit changeUrl(url);
}
+
+bool TerminalPanel::terminalHasFocus() const
+{
+ return m_terminalWidget->hasFocus();
+}