Commit 18faa88f authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: adding a setting for the context pane

parent 9d70d668
......@@ -48,6 +48,8 @@ void DesignerSettings::fromSettings(QSettings *settings)
QLatin1String(QmlDesigner::Constants::QML_ITEMSPACING_KEY), QVariant(0)).toInt();
snapMargin = settings->value(
QLatin1String(QmlDesigner::Constants::QML_SNAPMARGIN_KEY), QVariant(0)).toInt();
enableContextPane = settings->value(
QLatin1String(QmlDesigner::Constants::QML_CONTEXTPANE_KEY), QVariant(0)).toBool();
settings->endGroup();
settings->endGroup();
......@@ -60,6 +62,7 @@ void DesignerSettings::toSettings(QSettings *settings) const
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_OPENDESIGNMODE_SETTINGS_KEY), openDesignMode);
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_ITEMSPACING_KEY), itemSpacing);
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_SNAPMARGIN_KEY), snapMargin);
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_CONTEXTPANE_KEY), enableContextPane);
settings->endGroup();
settings->endGroup();
......@@ -69,6 +72,7 @@ bool DesignerSettings::equals(const DesignerSettings &other) const
{
return openDesignMode == other.openDesignMode
&& snapMargin == other.snapMargin
&& itemSpacing == other.itemSpacing;
&& itemSpacing == other.itemSpacing
&& enableContextPane == other.enableContextPane;
}
......@@ -50,6 +50,7 @@ public:
bool openDesignMode;
int itemSpacing;
int snapMargin;
bool enableContextPane;
};
inline bool operator==(const DesignerSettings &s1, const DesignerSettings &s2)
......
......@@ -61,6 +61,7 @@ const char * const QML_DESIGNER_SETTINGS_GROUP = "Designer";
const char * const QML_OPENDESIGNMODE_SETTINGS_KEY = "OpenDesignMode";
const char * const QML_ITEMSPACING_KEY = "ItemSpacing";
const char * const QML_SNAPMARGIN_KEY = "SnapMargin";
const char * const QML_CONTEXTPANE_KEY = "ContextPaneEnabled";
enum { QML_OPENDESIGNMODE_DEFAULT = 0 }; // 0 for text mode, 1 for design mode
const char * const SETTINGS_CATEGORY_QML_ICON = ":/core/images/category_qml.png";
......
......@@ -49,6 +49,7 @@ DesignerSettings SettingsPageWidget::settings() const
DesignerSettings ds;
ds.itemSpacing = m_ui.spinItemSpacing->value();
ds.snapMargin = m_ui.spinSnapMargin->value();
ds.enableContextPane = m_ui.textEditHelperCheckBox->isChecked();
return ds;
}
......@@ -56,6 +57,7 @@ void SettingsPageWidget::setSettings(const DesignerSettings &s)
{
m_ui.spinItemSpacing->setValue(s.itemSpacing);
m_ui.spinSnapMargin->setValue(s.snapMargin);
m_ui.textEditHelperCheckBox->setChecked(s.enableContextPane);
}
QString SettingsPageWidget::searchKeywords() const
......
......@@ -13,8 +13,8 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Snapping</string>
......@@ -98,7 +98,23 @@
</layout>
</widget>
</item>
<item row="3" column="0">
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Text Editor Helper</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="textEditHelperCheckBox">
<property name="text">
<string>enable</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......
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