Added scroll area to layout settings dialog.

This commit is contained in:
Roman Telezhynskyi 2022-02-03 17:05:52 +02:00
parent e876a4d611
commit 62ff405cc0
6 changed files with 570 additions and 512 deletions

View File

@ -30,6 +30,7 @@
- [smart-pattern/valentina#43] Background image.
- Fix alias for tool Cut Arc.
- Fix infinite loop in tool cut spline.
- Added scroll area to layout settings dialog.
# Valentina 0.7.49 July 1, 2021
- Fix crash.

View File

@ -516,7 +516,7 @@ QString DialogLayoutSettings::MakeGroupsHelp()
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::showEvent(QShowEvent *event)
{
QDialog::showEvent( event );
VAbstractLayoutDialog::showEvent( event );
if ( event->spontaneous() )
{
return;
@ -528,12 +528,28 @@ void DialogLayoutSettings::showEvent(QShowEvent *event)
}
// do your init stuff here
setMaximumSize(size());
setMinimumSize(size());
const QSize sz = VAbstractApplication::VApp()->Settings()->GetLayoutSettingsDialogSize();
if (not sz.isEmpty())
{
resize(sz);
}
isInitialized = true;//first show windows are held
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::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)
{
VAbstractApplication::VApp()->Settings()->SetLayoutSettingsDialogSize(size());
}
VAbstractLayoutDialog::resizeEvent(event);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::ConvertLayoutSize()
{

View File

@ -120,7 +120,8 @@ public:
qreal PageToPixels(qreal value) const;
static QString MakeGroupsHelp();
protected:
virtual void showEvent(QShowEvent *event) override;
void showEvent(QShowEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
QSizeF GetTemplateSize(const PaperSizeTemplate &tmpl, const Unit &unit) const;
public slots:

File diff suppressed because it is too large Load Diff

View File

@ -121,6 +121,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingToolSeamAllowanceDialogSize, (QL
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingIncrementsDialogSize, (QLatin1String("toolIncrementsDialogSize")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingFormulaWizardDialogSize, (QLatin1String("formulaWizardDialogSize")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingFinalMeasurementsDialogSize, (QLatin1String("finalMeasurementsDialogSize")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSettingsDialogSize, (QLatin1String("layoutSettingsDialogSize")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingAutomaticallyCheckUpdates, (QLatin1String("automaticallyCheckUpdates")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLatestSkippedVersion, (QLatin1String("lastestSkippedVersion")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDateOfLastRemind, (QLatin1String("dateOfLastRemind")))
@ -822,6 +823,18 @@ void VCommonSettings::SetFinalMeasurementsDialogSize(const QSize &sz)
setValue(*settingFinalMeasurementsDialogSize, sz);
}
//---------------------------------------------------------------------------------------------------------------------
auto VCommonSettings::GetLayoutSettingsDialogSize() const -> QSize
{
return value(*settingLayoutSettingsDialogSize, QSize(0, 0)).toSize();
}
//---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetLayoutSettingsDialogSize(const QSize &sz)
{
setValue(*settingLayoutSettingsDialogSize, sz);
}
//---------------------------------------------------------------------------------------------------------------------
bool VCommonSettings::IsAutomaticallyCheckUpdates() const
{

View File

@ -157,6 +157,9 @@ public:
QSize GetFinalMeasurementsDialogSize() const;
void SetFinalMeasurementsDialogSize(const QSize& sz);
QSize GetLayoutSettingsDialogSize() const;
void SetLayoutSettingsDialogSize(const QSize& sz);
bool IsAutomaticallyCheckUpdates() const;
void SetAutomaticallyCheckUpdates(bool value);