Commit 4d5b7325 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Redesigned the layout of the FakeVim options page

Also use spin boxes for the number inputs.

Reviewed-by: hjk
parent 5e96fa3a
......@@ -6,176 +6,156 @@
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<height>392</height>
<width>472</width>
<height>420</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="checkBoxUseFakeVim">
<property name="text">
<string>Use FakeVim</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBoxUseFakeVim">
<property name="text">
<string>Use FakeVim</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Vim style settings</string>
<string>Vim Behavior</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="1" column="0">
<widget class="QLabel" name="labelAutoIndent">
<property name="toolTip">
<string>VIM's &quot;autoindent&quot; option</string>
</property>
<property name="text">
<string>Automatic indentation:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="checkBoxAutoIndent">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelExpandTab">
<property name="toolTip">
<string>vim's &quot;expandtab&quot; option</string>
</property>
<property name="text">
<string>Expand tabulators:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBoxExpandTab">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelHlSearch">
<property name="text">
<string>Highlight search results:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBoxHlSearch">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelIncSearch">
<property name="text">
<string>Incremental search:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="checkBoxIncSearch">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="labelShiftWidth">
<property name="text">
<string>Shift width:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEditShiftWidth"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="labelSmartTab">
<property name="text">
<string>Smart tabulators:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="checkBoxSmartTab">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="labelStartOfLine">
<property name="text">
<string>Start of line:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="checkBoxStartOfLine">
<property name="text">
<string/>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxAutoIndent">
<property name="text">
<string>Automatic indentation</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="checkBoxStartOfLine">
<property name="text">
<string>Start of line</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSmartIndent">
<property name="text">
<string>Smart indentation</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="checkBoxUseCoreSearch">
<property name="text">
<string>Use search dialog</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxExpandTab">
<property name="text">
<string>Expand tabulators</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSmartTab">
<property name="text">
<string>Smart tabulators</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxHlSearch">
<property name="text">
<string>Highlight search results</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxIncSearch">
<property name="text">
<string>Incremental search</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="labelShiftWidth">
<property name="text">
<string>Shift width:</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QSpinBox" name="spinBoxShiftWidth">
<property name="maximum">
<number>999</number>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="tabulatorLabel">
<property name="toolTip">
<string>vim's &quot;tabstop&quot; option</string>
</property>
<property name="text">
<string>Tabulator size:</string>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="lineEditTabStop"/>
</item>
<item row="9" column="0">
<widget class="QLabel" name="labelBackspace">
<property name="text">
<string>Backspace:</string>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="lineEditBackspace"/>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="labelSmartIndent">
<property name="text">
<string>Smart indentation:</string>
</layout>
</item>
<item row="7" column="0">
<widget class="QLabel" name="labelTabulator">
<property name="toolTip">
<string>vim's &quot;tabstop&quot; option</string>
</property>
<property name="text">
<string>Tabulator size:</string>
</property>
</widget>
</item>
<item row="7" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QSpinBox" name="spinBoxTabStop">
<property name="maximum">
<number>999</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkBoxSmartIndent"/>
</item>
<item row="10" column="0">
<widget class="QLabel" name="labelUseCoreSearch">
<property name="text">
<string>Use search dialog:</string>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="checkBoxUseCoreSearch">
<property name="text">
<string/>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</item>
<item>
<item row="8" column="0">
<widget class="QLabel" name="labelBackspace">
<property name="text">
<string>Backspace:</string>
</property>
</widget>
</item>
<item row="8" column="1" colspan="2">
<widget class="QLineEdit" name="lineEditBackspace"/>
</item>
<item row="9" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -191,7 +171,7 @@
</property>
</spacer>
</item>
<item>
<item row="10" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButtonCopyTextEditorSettings">
......
......@@ -163,14 +163,14 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
m_group.insert(theFakeVimSetting(ConfigHlSearch),
m_ui.checkBoxHlSearch);
m_group.insert(theFakeVimSetting(ConfigShiftWidth),
m_ui.lineEditShiftWidth);
m_ui.spinBoxShiftWidth);
m_group.insert(theFakeVimSetting(ConfigSmartTab),
m_ui.checkBoxSmartTab);
m_group.insert(theFakeVimSetting(ConfigStartOfLine),
m_ui.checkBoxStartOfLine);
m_group.insert(theFakeVimSetting(ConfigTabStop),
m_ui.lineEditTabStop);
m_ui.spinBoxTabStop);
m_group.insert(theFakeVimSetting(ConfigBackspace),
m_ui.lineEditBackspace);
......@@ -191,16 +191,16 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
this, SLOT(setPlainStyle()));
if (m_searchKeywords.isEmpty()) {
QTextStream(&m_searchKeywords)
<< ' ' << m_ui.labelAutoIndent->text()
<< ' ' << m_ui.labelExpandTab->text()
<< ' ' << m_ui.labelSmartIndent->text()
<< ' ' << m_ui.labelExpandTab->text()
<< ' ' << m_ui.labelHlSearch->text()
<< ' ' << m_ui.labelIncSearch->text()
<< ' ' << m_ui.checkBoxAutoIndent->text()
<< ' ' << m_ui.checkBoxExpandTab->text()
<< ' ' << m_ui.checkBoxSmartIndent->text()
<< ' ' << m_ui.checkBoxExpandTab->text()
<< ' ' << m_ui.checkBoxHlSearch->text()
<< ' ' << m_ui.checkBoxIncSearch->text()
<< ' ' << m_ui.checkBoxSmartTab->text()
<< ' ' << m_ui.checkBoxStartOfLine->text()
<< ' ' << m_ui.labelShiftWidth->text()
<< ' ' << m_ui.labelSmartTab->text()
<< ' ' << m_ui.labelStartOfLine->text()
<< ' ' << m_ui.tabulatorLabel->text()
<< ' ' << m_ui.labelTabulator->text()
<< ' ' << m_ui.labelBackspace->text();
m_searchKeywords.remove(QLatin1Char('&'));
}
......@@ -213,8 +213,8 @@ void FakeVimOptionPage::copyTextEditorSettings()
TextEditor::TextEditorSettings::instance()->tabSettings();
m_ui.checkBoxExpandTab->setChecked(ts.m_spacesForTabs);
m_ui.lineEditTabStop->setText(QString::number(ts.m_tabSize));
m_ui.lineEditShiftWidth->setText(QString::number(ts.m_indentSize));
m_ui.spinBoxTabStop->setValue(ts.m_tabSize);
m_ui.spinBoxShiftWidth->setValue(ts.m_indentSize);
m_ui.checkBoxSmartTab->setChecked(ts.m_smartBackspace);
m_ui.checkBoxAutoIndent->setChecked(true);
m_ui.checkBoxSmartIndent->setChecked(ts.m_autoIndent);
......@@ -225,9 +225,8 @@ void FakeVimOptionPage::copyTextEditorSettings()
void FakeVimOptionPage::setQtStyle()
{
m_ui.checkBoxExpandTab->setChecked(true);
const QString four = QString(QLatin1Char('4'));
m_ui.lineEditTabStop->setText(four);
m_ui.lineEditShiftWidth->setText(four);
m_ui.spinBoxTabStop->setValue(4);
m_ui.spinBoxShiftWidth->setValue(4);
m_ui.checkBoxSmartTab->setChecked(true);
m_ui.checkBoxAutoIndent->setChecked(true);
m_ui.checkBoxSmartIndent->setChecked(true);
......@@ -238,9 +237,8 @@ void FakeVimOptionPage::setQtStyle()
void FakeVimOptionPage::setPlainStyle()
{
m_ui.checkBoxExpandTab->setChecked(false);
const QString eight = QString(QLatin1Char('4'));
m_ui.lineEditTabStop->setText(eight);
m_ui.lineEditShiftWidth->setText(eight);
m_ui.spinBoxTabStop->setValue(8);
m_ui.spinBoxShiftWidth->setValue(8);
m_ui.checkBoxSmartTab->setChecked(false);
m_ui.checkBoxAutoIndent->setChecked(false);
m_ui.checkBoxSmartIndent->setChecked(false);
......
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