forked from qt-creator/qt-creator
OutputPane: Use setter for priority and fix default visibility
Do not show the buttons of output views with priority < 0 (instead of only == -1). Reduce the number of buttons that are shown by default to the essential ones. Change-Id: I5b44f18537b3033ce9d616f044a8b54b76988783 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -365,6 +365,7 @@ SearchResultWindow::SearchResultWindow(QWidget *newSearchPanel)
|
||||
{
|
||||
setId("SearchResults");
|
||||
setDisplayName(Tr::tr("Search Results"));
|
||||
setPriorityInStatusBar(80);
|
||||
m_instance = this;
|
||||
readSettings();
|
||||
}
|
||||
@@ -657,14 +658,6 @@ void SearchResultWindow::writeSettings()
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
int SearchResultWindow::priorityInStatusBar() const
|
||||
{
|
||||
return 80;
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
|
||||
@@ -114,7 +114,6 @@ public:
|
||||
QWidget *outputWidget(QWidget *) override;
|
||||
QList<QWidget*> toolBarWidgets() const override;
|
||||
|
||||
int priorityInStatusBar() const override;
|
||||
void visibilityChanged(bool visible) override;
|
||||
bool hasFocus() const override;
|
||||
bool canFocus() const override;
|
||||
|
||||
@@ -49,16 +49,6 @@ namespace Core {
|
||||
Returns the toolbar widgets for the output pane.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int IOutputPane::priorityInStatusBar() const
|
||||
|
||||
Determines the position of the output pane on the status bar.
|
||||
\list
|
||||
\li 100 to 0 from front to end
|
||||
\li -1 do not show in status bar
|
||||
\endlist
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void IOutputPane::clearContents()
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
virtual const QList<OutputWindow *> outputWindows() const { return {}; }
|
||||
virtual void ensureWindowVisible(OutputWindow *) { }
|
||||
|
||||
virtual int priorityInStatusBar() const = 0;
|
||||
int priorityInStatusBar() const;
|
||||
|
||||
virtual void clearContents() = 0;
|
||||
virtual void visibilityChanged(bool visible);
|
||||
@@ -84,6 +84,7 @@ signals:
|
||||
protected:
|
||||
void setId(const Utils::Id &id);
|
||||
void setDisplayName(const QString &name);
|
||||
void setPriorityInStatusBar(int priority);
|
||||
|
||||
void setupFilterUi(const Utils::Key &historyKey);
|
||||
QString filterText() const;
|
||||
@@ -110,6 +111,7 @@ private:
|
||||
|
||||
Utils::Id m_id;
|
||||
QString m_displayName;
|
||||
int m_priority = -1;
|
||||
Core::CommandButton * const m_zoomInButton;
|
||||
Core::CommandButton * const m_zoomOutButton;
|
||||
QAction *m_filterActionRegexp = nullptr;
|
||||
|
||||
@@ -22,6 +22,8 @@ MessageOutputWindow::MessageOutputWindow()
|
||||
{
|
||||
setId("GeneralMessages");
|
||||
setDisplayName(Tr::tr("General Messages"));
|
||||
setPriorityInStatusBar(-100);
|
||||
|
||||
m_widget = new OutputWindow(Context(Constants::C_GENERAL_OUTPUT_PANE), zoomSettingsKey);
|
||||
m_widget->setReadOnly(true);
|
||||
|
||||
@@ -72,11 +74,6 @@ void MessageOutputWindow::append(const QString &text)
|
||||
m_widget->appendMessage(text, Utils::GeneralMessageFormat);
|
||||
}
|
||||
|
||||
int MessageOutputWindow::priorityInStatusBar() const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool MessageOutputWindow::canNext() const
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -20,7 +20,6 @@ public:
|
||||
|
||||
QWidget *outputWidget(QWidget *parent) override;
|
||||
|
||||
int priorityInStatusBar() const override;
|
||||
void clearContents() override;
|
||||
|
||||
void append(const QString &text);
|
||||
|
||||
@@ -128,6 +128,30 @@ QString IOutputPane::displayName() const
|
||||
return m_displayName;
|
||||
}
|
||||
|
||||
/*!
|
||||
Determines the position of the output pane on the status bar and the
|
||||
default visibility.
|
||||
\sa setPriorityInStatusBar()
|
||||
*/
|
||||
int IOutputPane::priorityInStatusBar() const
|
||||
{
|
||||
return m_priority;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the position of the output pane on the status bar and the default
|
||||
visibility to \a priority.
|
||||
\list
|
||||
\li higher numbers are further to the front
|
||||
\li >= 0 are shown in status bar by default
|
||||
\li < 0 are not shown in status bar by default
|
||||
\endlist
|
||||
*/
|
||||
void IOutputPane::setPriorityInStatusBar(int priority)
|
||||
{
|
||||
m_priority = priority;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the translated display name of the output pane to \a name.
|
||||
*/
|
||||
@@ -522,7 +546,7 @@ void OutputPaneManager::initialize()
|
||||
m_instance->buttonTriggered(i);
|
||||
});
|
||||
|
||||
bool visible = outPane->priorityInStatusBar() != -1;
|
||||
const bool visible = outPane->priorityInStatusBar() >= 0;
|
||||
data.button->setVisible(visible);
|
||||
|
||||
connect(data.action, &QAction::triggered, m_instance, [i] {
|
||||
|
||||
Reference in New Issue
Block a user