forked from qt-creator/qt-creator
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:
@@ -89,6 +89,15 @@ TerminalPane::TerminalPane(QObject *parent)
|
|||||||
if (canPrevious())
|
if (canPrevious())
|
||||||
goToPrev();
|
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()
|
static std::optional<FilePath> startupProjectDirectory()
|
||||||
@@ -189,7 +198,7 @@ void TerminalPane::setupTerminalWidget(TerminalWidget *terminal)
|
|||||||
if (!terminal->shellName().isEmpty())
|
if (!terminal->shellName().isEmpty())
|
||||||
setTabText(terminal);
|
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
|
QList<QWidget *> TerminalPane::toolBarWidgets() const
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ private:
|
|||||||
QAction m_closeTerminal;
|
QAction m_closeTerminal;
|
||||||
QAction m_nextTerminal;
|
QAction m_nextTerminal;
|
||||||
QAction m_prevTerminal;
|
QAction m_prevTerminal;
|
||||||
|
QAction m_minMaxAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Terminal
|
} // namespace Terminal
|
||||||
|
|||||||
Reference in New Issue
Block a user