forked from qt-creator/qt-creator
Editor: simplify behavior settings page
Layout the groupboxes of this page in a single column layout instead of trying to compress them in two columns. Additionally transform some of the groupbox layouts to form layouts that make more use of the now increased horizontal space and take less vertical space. Change-Id: Id481221816be7752b0e245f7be101019b6f65727 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -67,7 +67,6 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
|
||||
, d(new BehaviorSettingsWidgetPrivate)
|
||||
{
|
||||
d->tabPreferencesWidget = new SimpleCodeStylePreferencesWidget(this);
|
||||
d->tabPreferencesWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); // FIXME: Desirable?
|
||||
|
||||
d->tabKeyBehavior = new QComboBox;
|
||||
d->tabKeyBehavior->addItem(Tr::tr("Never"));
|
||||
@@ -165,7 +164,6 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
|
||||
|
||||
d->encodingBox = new CodecChooser;
|
||||
d->encodingBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);
|
||||
d->encodingBox->setMinimumContentsLength(20);
|
||||
|
||||
d->utf8BomBox = new QComboBox;
|
||||
d->utf8BomBox->addItem(Tr::tr("Add If Encoding Is UTF-8"));
|
||||
@@ -210,15 +208,14 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
|
||||
|
||||
const auto indent = [](QWidget *inner) { return Row { Space(30), inner }; };
|
||||
|
||||
Column {
|
||||
d->autoIndent,
|
||||
Tr::tr("Backspace indentation:"),
|
||||
indent(d->smartBackspaceBehavior),
|
||||
Tr::tr("Tab key performs auto-indent:"),
|
||||
indent(d->tabKeyBehavior),
|
||||
d->preferSingleLineComments,
|
||||
commentPositionLabel,
|
||||
indent(d->commentPosition)
|
||||
Row {
|
||||
Form {
|
||||
d->autoIndent, br,
|
||||
Tr::tr("Backspace indentation:"), d->smartBackspaceBehavior, br,
|
||||
Tr::tr("Tab key performs auto-indent:"), d->tabKeyBehavior, br,
|
||||
d->preferSingleLineComments, br,
|
||||
commentPositionLabel, d->commentPosition, br
|
||||
}, st
|
||||
}.attachTo(d->groupBoxTyping);
|
||||
|
||||
Column {
|
||||
@@ -237,20 +234,25 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
|
||||
}, st
|
||||
}.attachTo(d->groupBoxEncodings);
|
||||
|
||||
Column {
|
||||
d->mouseHiding,
|
||||
d->mouseNavigation,
|
||||
d->scrollWheelZooming,
|
||||
d->camelCaseNavigation,
|
||||
d->smartSelectionChanging,
|
||||
d->keyboardTooltips,
|
||||
Tr::tr("Show help tooltips using the mouse:"),
|
||||
Row { Space(30), d->constrainTooltipsBox, st }
|
||||
Row {
|
||||
Form {
|
||||
d->mouseHiding, br,
|
||||
d->mouseNavigation, br,
|
||||
d->scrollWheelZooming, br,
|
||||
d->camelCaseNavigation, br,
|
||||
d->smartSelectionChanging, br,
|
||||
d->keyboardTooltips, br,
|
||||
Tr::tr("Show help tooltips using the mouse:"), d->constrainTooltipsBox, br
|
||||
}, st
|
||||
}.attachTo(d->groupBoxMouse);
|
||||
|
||||
Row {
|
||||
Column { d->tabPreferencesWidget, d->groupBoxTyping, st },
|
||||
Column { d->groupBoxStorageSettings, d->groupBoxEncodings, d->groupBoxMouse, st },
|
||||
Column {
|
||||
d->tabPreferencesWidget,
|
||||
d->groupBoxTyping,
|
||||
d->groupBoxStorageSettings,
|
||||
d->groupBoxEncodings,
|
||||
d->groupBoxMouse,
|
||||
st,
|
||||
noMargin,
|
||||
}.attachTo(this);
|
||||
|
||||
|
@@ -56,13 +56,11 @@ TabSettingsWidget::TabSettingsWidget(QWidget *parent) :
|
||||
Tr::tr("<i>Code indentation is configured in <a href=\"C++\">C++</a> "
|
||||
"and <a href=\"QtQuick\">Qt Quick</a> settings.</i>"));
|
||||
m_codingStyleWarning->setVisible(false);
|
||||
m_codingStyleWarning->setWordWrap(true);
|
||||
m_codingStyleWarning->setToolTip(
|
||||
Tr::tr("The text editor indentation setting is used for non-code files only. See the C++ "
|
||||
"and Qt Quick coding style settings to configure indentation for code files."));
|
||||
|
||||
m_tabPolicy = new QComboBox(this);
|
||||
m_tabPolicy->setMinimumContentsLength(28);
|
||||
m_tabPolicy->addItem(Tr::tr("Spaces Only"));
|
||||
m_tabPolicy->addItem(Tr::tr("Tabs Only"));
|
||||
m_tabPolicy->addItem(Tr::tr("Mixed"));
|
||||
@@ -87,15 +85,15 @@ TabSettingsWidget::TabSettingsWidget(QWidget *parent) :
|
||||
indentSizeLabel->setBuddy(m_indentSize);
|
||||
|
||||
using namespace Layouting;
|
||||
const auto indent = [](QWidget *inner) { return Row { Space(30), inner }; };
|
||||
|
||||
Column {
|
||||
m_codingStyleWarning,
|
||||
Tr::tr("Tab policy:"),
|
||||
indent(m_tabPolicy),
|
||||
Row { tabSizeLabel, m_tabSize, indentSizeLabel, m_indentSize, st },
|
||||
Tr::tr("Align continuation lines:"),
|
||||
indent(m_continuationAlignBehavior)
|
||||
Row {
|
||||
Form {
|
||||
m_codingStyleWarning, br,
|
||||
Tr::tr("Tab policy:"), m_tabPolicy, br,
|
||||
tabSizeLabel, m_tabSize, br,
|
||||
indentSizeLabel, m_indentSize, br,
|
||||
Tr::tr("Align continuation lines:"), m_continuationAlignBehavior, br
|
||||
}, st
|
||||
}.attachTo(this);
|
||||
|
||||
connect(m_codingStyleWarning, &QLabel::linkActivated,
|
||||
|
Reference in New Issue
Block a user