diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp
index 7f57d3694..1da4f4d41 100644
--- a/src/app/valentina/dialogs/dialogincrements.cpp
+++ b/src/app/valentina/dialogs/dialogincrements.cpp
@@ -864,6 +864,44 @@ bool DialogIncrements::eventFilter(QObject *object, QEvent *event)
return false;// pass the event to the widget
}
+//---------------------------------------------------------------------------------------------------------------------
+void DialogIncrements::showEvent(QShowEvent *event)
+{
+ // Skip DialogTool implementation
+ QDialog::showEvent(event);
+ if ( event->spontaneous() )
+ {
+ return;
+ }
+
+ if (isInitialized)
+ {
+ return;
+ }
+ // do your init stuff here
+
+ const QSize sz = qApp->Settings()->GetIncrementsDialogSize();
+ if (not sz.isEmpty())
+ {
+ resize(sz);
+ }
+
+ isInitialized = true;//first show windows are held
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void DialogIncrements::resizeEvent(QResizeEvent *event)
+{
+ // remember the size for the next time this dialog is opened, but only
+ // if widget was already initialized, which rules out the resize at
+ // dialog creating, which would
+ if (isInitialized)
+ {
+ qApp->Settings()->SetIncrementsDialogSize(size());
+ }
+ DialogTool::resizeEvent(event);
+}
+
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::ShowIncrementDetails()
{
diff --git a/src/app/valentina/dialogs/dialogincrements.h b/src/app/valentina/dialogs/dialogincrements.h
index 63a85bee4..125c42b0b 100644
--- a/src/app/valentina/dialogs/dialogincrements.h
+++ b/src/app/valentina/dialogs/dialogincrements.h
@@ -47,13 +47,15 @@ class DialogIncrements : public DialogTool
{
Q_OBJECT
public:
- DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent = nullptr);
- virtual ~DialogIncrements() Q_DECL_OVERRIDE;
+ DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent = nullptr);
+ virtual ~DialogIncrements() Q_DECL_OVERRIDE;
protected:
virtual void closeEvent ( QCloseEvent * event ) Q_DECL_OVERRIDE;
virtual void changeEvent ( QEvent * event) Q_DECL_OVERRIDE;
virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
+ virtual void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE;
+ virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
private slots:
void ShowIncrementDetails();
void AddIncrement();
diff --git a/src/app/valentina/dialogs/dialogincrements.ui b/src/app/valentina/dialogs/dialogincrements.ui
index 7d3979836..6e377652e 100644
--- a/src/app/valentina/dialogs/dialogincrements.ui
+++ b/src/app/valentina/dialogs/dialogincrements.ui
@@ -6,8 +6,8 @@
0
0
- 979
- 729
+ 800
+ 497
diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp
index 1f3b8b168..4a38fef82 100644
--- a/src/libs/vmisc/vcommonsettings.cpp
+++ b/src/libs/vmisc/vcommonsettings.cpp
@@ -75,6 +75,7 @@ const QString settingGeneralWindowState = QStringLiteral("windowState")
const QString settingGeneralToolbarsState = QStringLiteral("toolbarsState");
const QString settingPreferenceDialogSize = QStringLiteral("preferenceDialogSize");
const QString settingToolSeamAllowanceDialogSize = QStringLiteral("toolSeamAllowanceDialogSize");
+const QString settingIncrementsDialogSize = QStringLiteral("toolIncrementsDialogSize");
const QString settingFormulaWizardDialogSize = QStringLiteral("formulaWizardDialogSize");
const QString settingLatestSkippedVersion = QStringLiteral("lastestSkippedVersion");
const QString settingDateOfLastRemind = QStringLiteral("dateOfLastRemind");
@@ -587,6 +588,18 @@ void VCommonSettings::SetFormulaWizardDialogSize(const QSize &sz)
setValue(settingFormulaWizardDialogSize, sz);
}
+//---------------------------------------------------------------------------------------------------------------------
+QSize VCommonSettings::GetIncrementsDialogSize() const
+{
+ return value(settingIncrementsDialogSize, QSize(0, 0)).toSize();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VCommonSettings::SetIncrementsDialogSize(const QSize &sz)
+{
+ setValue(settingIncrementsDialogSize, sz);
+}
+
//---------------------------------------------------------------------------------------------------------------------
int VCommonSettings::GetLatestSkippedVersion() const
{
diff --git a/src/libs/vmisc/vcommonsettings.h b/src/libs/vmisc/vcommonsettings.h
index fa9a2cac2..fb2c79bba 100644
--- a/src/libs/vmisc/vcommonsettings.h
+++ b/src/libs/vmisc/vcommonsettings.h
@@ -126,6 +126,9 @@ public:
QSize GetFormulaWizardDialogSize() const;
void SetFormulaWizardDialogSize(const QSize& sz);
+ QSize GetIncrementsDialogSize() const;
+ void SetIncrementsDialogSize(const QSize& sz);
+
int GetLatestSkippedVersion() const;
void SetLatestSkippedVersion(int value);