Core: Fix enabling/disabling of zoomIn/Out buttons in output panes

Amends 48073b2990 to avoid the creation of extra toplevel windows (and
warnings on MS Windows on startup).

Also, ensure that that the initial tab-less application output pane
shows the buttons, albeit in disabled state. All other output panes do
not have to explicitly enable them.

Change-Id: I6c6ef374c09c77e2eb953743071917d9346ca85d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2019-04-23 18:03:12 +02:00
parent 261d7752b0
commit c453e896a0
5 changed files with 2 additions and 9 deletions

View File

@@ -54,7 +54,6 @@ MessageOutputWindow::MessageOutputWindow()
p.setColor(QPalette::HighlightedText, activeHighlightedText);
m_widget->setPalette(p);
setZoomButtonsEnabled(true);
connect(this, &IOutputPane::zoomIn, m_widget, &Core::OutputWindow::zoomIn);
connect(this, &IOutputPane::zoomOut, m_widget, &Core::OutputWindow::zoomOut);
connect(this, &IOutputPane::fontChanged, m_widget, &OutputWindow::setBaseFont);

View File

@@ -98,14 +98,10 @@ IOutputPane::IOutputPane(QObject *parent)
m_zoomInButton->setToolTip(tr("Increase Font Size"));
m_zoomInButton->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
m_zoomInButton->setAutoRaise(true);
m_zoomInButton->setVisible(false);
connect(m_zoomInButton, &QToolButton::clicked, this, [this] { emit zoomIn(1); });
m_zoomOutButton->setToolTip(tr("Decrease Font Size"));
m_zoomOutButton->setIcon(Utils::Icons::MINUS.icon());
m_zoomOutButton->setAutoRaise(true);
m_zoomOutButton->setVisible(false);
connect(m_zoomOutButton, &QToolButton::clicked, this, [this] { emit zoomOut(1); });
}
@@ -137,9 +133,7 @@ void IOutputPane::setWheelZoomEnabled(bool enabled)
void IOutputPane::setZoomButtonsEnabled(bool enabled)
{
m_zoomInButton->setEnabled(enabled);
m_zoomInButton->setVisible(true);
m_zoomOutButton->setEnabled(enabled);
m_zoomOutButton->setVisible(true);
}
namespace Internal {

View File

@@ -282,6 +282,8 @@ AppOutputPane::AppOutputPane() :
connect(SessionManager::instance(), &SessionManager::aboutToUnloadSession,
this, &AppOutputPane::aboutToUnloadSession);
setZoomButtonsEnabled(false);
}
AppOutputPane::~AppOutputPane()

View File

@@ -170,7 +170,6 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
TextEditor::TextEditorSettings::behaviorSettings().m_scrollWheelZooming);
};
setZoomButtonsEnabled(true);
updateFontSettings();
updateZoomEnabled();

View File

@@ -300,7 +300,6 @@ VcsOutputWindow::VcsOutputWindow()
TextEditor::TextEditorSettings::behaviorSettings().m_scrollWheelZooming);
};
setZoomButtonsEnabled(true);
updateFontSettings();
updateBehaviorSettings();