forked from qt-creator/qt-creator
Terminal: Add context menu & Settings button
Fixes: QTCREATORBUG-28937 Change-Id: I9dab5da0adccb8cff4d4e824ead0eba3e27eef5c Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <QMenu>
|
||||
#include <QStandardPaths>
|
||||
#include <QtWidgets/qwidget.h>
|
||||
#include <QToolButton>
|
||||
|
||||
namespace Terminal {
|
||||
|
||||
@@ -111,6 +111,14 @@ TerminalPane::TerminalPane(QObject *parent)
|
||||
if (minMaxCommand)
|
||||
emit minMaxCommand->action()->triggered();
|
||||
});
|
||||
|
||||
m_openSettingsButton = new QToolButton();
|
||||
m_openSettingsButton->setToolTip(Tr::tr("Open Terminal Settings"));
|
||||
m_openSettingsButton->setIcon(Icons::SETTINGS_TOOLBAR.icon());
|
||||
|
||||
connect(m_openSettingsButton, &QToolButton::clicked, m_openSettingsButton, []() {
|
||||
TerminalCommands::openSettingsAction()->trigger();
|
||||
});
|
||||
}
|
||||
|
||||
TerminalPane::~TerminalPane()
|
||||
@@ -252,7 +260,7 @@ QList<QWidget *> TerminalPane::toolBarWidgets() const
|
||||
widgets.prepend(m_newTerminalButton);
|
||||
widgets.prepend(m_closeTerminalButton);
|
||||
|
||||
return widgets;
|
||||
return widgets << m_openSettingsButton;
|
||||
}
|
||||
|
||||
QString TerminalPane::displayName() const
|
||||
|
||||
Reference in New Issue
Block a user