Terminal: add minMax terminal panel keyboard shortcut

On Windows the terminal (both cmd and Terminal) have Alt+Return as
fullscreen.

For Qt Creator this will map to the minMax Terminal panel action.

Change-Id: I04594850a0fafa8f620dc81d0b5b49937c12a0cd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Cristian Adam
2023-03-09 20:08:49 +01:00
parent e54b0e93c2
commit ce091cbcca
2 changed files with 11 additions and 1 deletions

View File

@@ -89,6 +89,15 @@ TerminalPane::TerminalPane(QObject *parent)
if (canPrevious())
goToPrev();
});
m_minMaxAction.setShortcut(QKeySequence(HostOsInfo::isMacHost() ? QLatin1String("Ctrl+Return")
: QLatin1String("Alt+Return")));
connect(&m_minMaxAction, &QAction::triggered, this, []() {
Core::Command *minMaxCommand = Core::ActionManager::command("Coreplugin.OutputPane.minmax");
if (minMaxCommand)
emit minMaxCommand->action()->triggered();
});
}
static std::optional<FilePath> startupProjectDirectory()
@@ -189,7 +198,7 @@ void TerminalPane::setupTerminalWidget(TerminalWidget *terminal)
if (!terminal->shellName().isEmpty())
setTabText(terminal);
terminal->addActions({&m_newTerminal, &m_nextTerminal, &m_prevTerminal});
terminal->addActions({&m_newTerminal, &m_nextTerminal, &m_prevTerminal, &m_minMaxAction});
}
QList<QWidget *> TerminalPane::toolBarWidgets() const