Commit 9a1a0065 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Rename margins to padding



The old name was misleading.

Change-Id: I253b21530e0f2c7c68c4850190d791aeb8567172
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 61828eda
......@@ -556,9 +556,9 @@ void FormEditorView::rewriterEndTransaction()
m_transactionCounter--;
}
double FormEditorView::margins() const
double FormEditorView::containerPadding() const
{
return m_formEditorWidget->margins();
return m_formEditorWidget->containerPadding();
}
double FormEditorView::spacing() const
......
......@@ -119,7 +119,7 @@ public:
void rewriterBeginTransaction() QTC_OVERRIDE;
void rewriterEndTransaction() QTC_OVERRIDE;
double margins() const;
double containerPadding() const;
double spacing() const;
void deActivateItemCreator();
......
......@@ -290,10 +290,10 @@ double FormEditorWidget::spacing() const
return settings.itemSpacing;
}
double FormEditorWidget::margins() const
double FormEditorWidget::containerPadding() const
{
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
return settings.snapMargin;
return settings.containerPadding;
}
......
......@@ -65,7 +65,7 @@ public:
ToolBox *toolBox() const;
double spacing() const;
double margins() const;
double containerPadding() const;
QString contextHelpId() const;
......
......@@ -40,10 +40,10 @@ SnappingLineCreator::SnappingLineCreator(FormEditorItem *formEditorItem)
m_bottomOffset(formEditorItem->formEditorView()->spacing()),
m_leftOffset(formEditorItem->formEditorView()->spacing()),
m_rightOffset(formEditorItem->formEditorView()->spacing()),
m_topMargin(formEditorItem->formEditorView()->margins()),
m_bottomMargin(formEditorItem->formEditorView()->margins()),
m_leftMargin(formEditorItem->formEditorView()->margins()),
m_rightMargin(formEditorItem->formEditorView()->margins())
m_topPadding(formEditorItem->formEditorView()->containerPadding()),
m_bottomPadding(formEditorItem->formEditorView()->containerPadding()),
m_leftPadding(formEditorItem->formEditorView()->containerPadding()),
m_rightPadding(formEditorItem->formEditorView()->containerPadding())
{
Q_ASSERT(m_formEditorItem);
}
......@@ -95,7 +95,7 @@ void SnappingLineCreator::generateLines(const QList<FormEditorItem*> &exceptionL
m_formEditorItem->qmlItemNode().instanceBoundingRect());
addLines(containerBoundingRectInTransformationSpace, m_formEditorItem);
containerBoundingRectInTransformationSpace.adjust(m_leftMargin, m_topMargin, -m_rightMargin, -m_rightMargin);
containerBoundingRectInTransformationSpace.adjust(m_leftPadding, m_topPadding, -m_rightPadding, -m_rightPadding);
addLines(containerBoundingRectInTransformationSpace, m_formEditorItem);
}
......@@ -117,12 +117,12 @@ void SnappingLineCreator::generateLines(const QList<FormEditorItem*> &exceptionL
}
}
void SnappingLineCreator::setMargins(double margin)
void SnappingLineCreator::setContainerPadding(double containerPadding)
{
m_topMargin = margin;
m_bottomMargin = margin;
m_leftMargin = margin;
m_rightMargin = margin;
m_topPadding = containerPadding;
m_bottomPadding = containerPadding;
m_leftPadding = containerPadding;
m_rightPadding = containerPadding;
}
void SnappingLineCreator::setSpacing(double spacing)
......@@ -137,7 +137,7 @@ void SnappingLineCreator::update(const QList<FormEditorItem*> &exceptionList,
FormEditorItem *transformationSpaceItem)
{
clearLines();
setMargins(m_formEditorItem->formEditorView()->margins());
setContainerPadding(m_formEditorItem->formEditorView()->containerPadding());
setSpacing(m_formEditorItem->formEditorView()->spacing());
generateLines(exceptionList, transformationSpaceItem);
}
......
......@@ -63,7 +63,7 @@ public:
SnapLineMap leftOffsets() const;
SnapLineMap rightOffsets() const;
void setMargins(double margin);
void setContainerPadding(double containerPadding);
void setSpacing(double spacing);
protected:
......@@ -92,10 +92,10 @@ private:
double m_bottomOffset;
double m_leftOffset;
double m_rightOffset;
double m_topMargin;
double m_bottomMargin;
double m_leftMargin;
double m_rightMargin;
double m_topPadding;
double m_bottomPadding;
double m_leftPadding;
double m_rightPadding;
};
}
......
......@@ -37,7 +37,7 @@ using namespace QmlDesigner;
DesignerSettings::DesignerSettings()
: openDesignMode(QmlDesigner::Constants::QML_OPENDESIGNMODE_DEFAULT),
itemSpacing(0),
snapMargin(0),
containerPadding(0),
canvasWidth(10000),
canvasHeight(10000),
warningsInDesigner(true),
......@@ -55,8 +55,8 @@ void DesignerSettings::fromSettings(QSettings *settings)
bool(QmlDesigner::Constants::QML_OPENDESIGNMODE_DEFAULT)).toBool();
itemSpacing = settings->value(
QLatin1String(QmlDesigner::Constants::QML_ITEMSPACING_KEY), QVariant(6)).toInt();
snapMargin = settings->value(
QLatin1String(QmlDesigner::Constants::QML_SNAPMARGIN_KEY), QVariant(8)).toInt();
containerPadding = settings->value(
QLatin1String(QmlDesigner::Constants::QML_CONTAINERPADDING_KEY), QVariant(8)).toInt();
canvasWidth = settings->value(QLatin1String(QmlDesigner::Constants::QML_CANVASWIDTH_KEY), QVariant(10000)).toInt();
canvasHeight = settings->value(QLatin1String(QmlDesigner::Constants::QML_CANVASHEIGHT_KEY), QVariant(10000)).toInt();
warningsInDesigner = settings->value(
......@@ -78,7 +78,7 @@ void DesignerSettings::toSettings(QSettings *settings) const
settings->beginGroup(QLatin1String(QmlDesigner::Constants::QML_DESIGNER_SETTINGS_GROUP));
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_CONTAINERPADDING_KEY), containerPadding);
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_CANVASWIDTH_KEY), canvasWidth);
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_CANVASHEIGHT_KEY), canvasHeight);
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_WARNIN_FOR_FEATURES_IN_DESIGNER_KEY), warningsInDesigner);
......@@ -93,7 +93,7 @@ void DesignerSettings::toSettings(QSettings *settings) const
bool DesignerSettings::equals(const DesignerSettings &other) const
{
return openDesignMode == other.openDesignMode
&& snapMargin == other.snapMargin
&& containerPadding == other.containerPadding
&& canvasWidth == other.canvasWidth
&& canvasHeight == other.canvasHeight
&& warningsInDesigner == other.warningsInDesigner
......
......@@ -49,7 +49,7 @@ public:
bool equals(const DesignerSettings &other) const;
bool openDesignMode;
int itemSpacing;
int snapMargin;
int containerPadding;
int canvasWidth;
int canvasHeight;
bool warningsInDesigner;
......
......@@ -55,7 +55,7 @@ const char QML_SETTINGS_GROUP[] = "QML";
const char QML_DESIGNER_SETTINGS_GROUP[] = "Designer";
const char QML_OPENDESIGNMODE_SETTINGS_KEY[] = "OpenDesignMode";
const char QML_ITEMSPACING_KEY[] = "ItemSpacing";
const char QML_SNAPMARGIN_KEY[] = "SnapMargin";
const char QML_CONTAINERPADDING_KEY[] = "ContainerPadding";
const char QML_CANVASWIDTH_KEY[] = "CanvasWidth";
const char QML_CANVASHEIGHT_KEY[] = "CanvasHeight";
const char QML_CONTEXTPANE_KEY[] = "ContextPaneEnabled";
......
......@@ -50,7 +50,7 @@ DesignerSettings SettingsPageWidget::settings() const
{
DesignerSettings designerSettings;
designerSettings.itemSpacing = m_ui.spinItemSpacing->value();
designerSettings.snapMargin = m_ui.spinSnapMargin->value();
designerSettings.containerPadding = m_ui.spinSnapMargin->value();
designerSettings.canvasWidth = m_ui.spinCanvasWidth->value();
designerSettings.canvasHeight = m_ui.spinCanvasHeight->value();
designerSettings.warningsInDesigner = m_ui.designerWarningsCheckBox->isChecked();
......@@ -64,7 +64,7 @@ DesignerSettings SettingsPageWidget::settings() const
void SettingsPageWidget::setSettings(const DesignerSettings &designerSettings)
{
m_ui.spinItemSpacing->setValue(designerSettings.itemSpacing);
m_ui.spinSnapMargin->setValue(designerSettings.snapMargin);
m_ui.spinSnapMargin->setValue(designerSettings.containerPadding);
m_ui.spinCanvasWidth->setValue(designerSettings.canvasWidth);
m_ui.spinCanvasHeight->setValue(designerSettings.canvasHeight);
m_ui.designerWarningsCheckBox->setChecked(designerSettings.warningsInDesigner);
......
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