Commit dce4f03f authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppEditor: Rearrange toolbar widgets

Move the parse context switcher and the additional preprocessor dialog
button to the left. Thus, the new order is:

        ...
        minimized info bar buttons (not always there)
        additional preprocessor directives button ('#')
        parse context switcher (not always there)
        outline widget
        ...

This is better for splits and makes logically also more sense since the
outline widget depends on the additional preprocessor directives and/or
the parse context.

Change-Id: I3378885a44938072e6a496ce1573d1675499c498
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
parent 7f73f395
......@@ -223,14 +223,8 @@ void CppEditorWidget::finalizeInitialization()
d->m_cppSelectionChanger.onCursorPositionChanged(textCursor());
});
// Toolbar: '#' Button
d->m_preprocessorButton = new QToolButton(this);
d->m_preprocessorButton->setText(QLatin1String("#"));
Command *cmd = ActionManager::command(Constants::OPEN_PREPROCESSOR_DIALOG);
connect(cmd, &Command::keySequenceChanged, this, &CppEditorWidget::updatePreprocessorButtonTooltip);
updatePreprocessorButtonTooltip();
connect(d->m_preprocessorButton, &QAbstractButton::clicked, this, &CppEditorWidget::showPreProcessorWidget);
insertExtraToolBarWidget(TextEditorWidget::Left, d->m_preprocessorButton);
// Toolbar: Outline/Overview combo box
insertExtraToolBarWidget(TextEditorWidget::Left, d->m_cppEditorOutline->widget());
// Toolbar: Parse context
ParseContextModel &parseContextModel = cppEditorDocument()->parseContextModel();
......@@ -243,8 +237,14 @@ void CppEditorWidget::finalizeInitialization()
d->m_parseContextAction->setVisible(areMultipleAvailable);
});
// Toolbar: Outline/Overview combo box
insertExtraToolBarWidget(TextEditorWidget::Left, d->m_cppEditorOutline->widget());
// Toolbar: '#' Button
d->m_preprocessorButton = new QToolButton(this);
d->m_preprocessorButton->setText(QLatin1String("#"));
Command *cmd = ActionManager::command(Constants::OPEN_PREPROCESSOR_DIALOG);
connect(cmd, &Command::keySequenceChanged, this, &CppEditorWidget::updatePreprocessorButtonTooltip);
updatePreprocessorButtonTooltip();
connect(d->m_preprocessorButton, &QAbstractButton::clicked, this, &CppEditorWidget::showPreProcessorWidget);
insertExtraToolBarWidget(TextEditorWidget::Left, d->m_preprocessorButton);
// Toolbar: Actions to show minimized info bars
d->m_showInfoBarActions = MinimizableInfoBars::createShowInfoBarActions([this](QWidget *w) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment