diff --git a/src/plugins/coreplugin/core.qrc b/src/plugins/coreplugin/core.qrc index 3767f039259c6bff8600b8c47b3fe0f3da958300..a38f9d148c4cd8c5419932b4ad61c147751de17e 100644 --- a/src/plugins/coreplugin/core.qrc +++ b/src/plugins/coreplugin/core.qrc @@ -57,5 +57,7 @@ <file>images/darkarrowdown.png</file> <file>images/darkarrowup.png</file> <file>images/darkclose.png</file> + <file>images/arrowdown.png</file> + <file>images/arrowup.png</file> </qresource> </RCC> diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index 89903d7f6d50acff1beb487b05a9283967b093cf..e3b48e003193b860f830e39f3eca3b603476f5c6 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -201,7 +201,10 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) : m_prevAction(0), m_lastIndex(-1), m_outputWidgetPane(new QStackedWidget), - m_opToolBarWidgets(new QStackedWidget) + m_opToolBarWidgets(new QStackedWidget), + m_minimizeIcon(":/core/images/arrowdown.png"), + m_maximizeIcon(":/core/images/arrowup.png"), + m_maximised(false) { setWindowTitle(tr("Output")); connect(m_widgetComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changePage())); @@ -221,8 +224,9 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) : connect(m_prevAction, SIGNAL(triggered()), this, SLOT(slotPrev())); m_minMaxAction = new QAction(this); - m_minMaxAction->setText(tr("Maximize Output Pane")); - m_minMaxButton->setArrowType(Qt::UpArrow); + m_minMaxButton->setIcon(m_maximizeIcon); + m_minMaxButton->setToolTip(tr("Maximize Output Pane")); + m_minMaxAction->setText(m_minMaxButton->toolTip()); m_closeButton->setIcon(QIcon(":/core/images/closebutton.png")); connect(m_closeButton, SIGNAL(clicked()), this, SLOT(slotHide())); @@ -309,8 +313,8 @@ void OutputPaneManager::init() #endif cmd->setAttribute(Command::CA_UpdateText); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); - m_minMaxButton->setDefaultAction(cmd->action()); connect(m_minMaxAction, SIGNAL(triggered()), this, SLOT(slotMinMax())); + connect(m_minMaxButton, SIGNAL(clicked()), this, SLOT(slotMinMax())); QAction *sep = new QAction(this); sep->setSeparator(true); @@ -403,7 +407,7 @@ void OutputPaneManager::shortcutTriggered() bool OutputPaneManager::isMaximized()const { - return m_minMaxButton->arrowType() == Qt::DownArrow; + return m_maximised; } void OutputPaneManager::slotMinMax() @@ -412,11 +416,12 @@ void OutputPaneManager::slotMinMax() if (!OutputPanePlaceHolder::m_current->isVisible()) // easier than disabling/enabling the action return; - bool maximize = m_minMaxButton->arrowType() == Qt::UpArrow; - OutputPanePlaceHolder::m_current->maximizeOrMinimize(maximize); - m_minMaxButton->setArrowType(maximize ? Qt::DownArrow : Qt::UpArrow); - m_minMaxAction->setToolTip(maximize ? tr("Minimize Output Pane") - : tr("Maximize Output Pane")); + m_maximised = !m_maximised; + OutputPanePlaceHolder::m_current->maximizeOrMinimize(m_maximised); + m_minMaxButton->setIcon(m_maximised ? m_minimizeIcon : m_maximizeIcon); + m_minMaxButton->setToolTip(m_maximised ? tr("Minimize Output Pane") + : tr("Maximize Output Pane")); + m_minMaxAction->setText(m_minMaxButton->toolTip()); } void OutputPaneManager::buttonTriggered() diff --git a/src/plugins/coreplugin/outputpane.h b/src/plugins/coreplugin/outputpane.h index 64a0a0f7765e9e7e0b820c8aafcc6a6e34f7efe5..edfad8bb500d5d5e0643037dd44c07cb0ef40542 100644 --- a/src/plugins/coreplugin/outputpane.h +++ b/src/plugins/coreplugin/outputpane.h @@ -148,6 +148,9 @@ private: QWidget *m_buttonsWidget; QMap<int, QPushButton *> m_buttons; QMap<QAction *, int> m_actions; + QPixmap m_minimizeIcon; + QPixmap m_maximizeIcon; + bool m_maximised; }; class OutputPaneToggleButton : public QPushButton