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:

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>601</width>
<height>664</height>
<width>772</width>
<height>701</height>
</rect>
</property>
<property name="windowTitle">
@ -17,11 +17,24 @@
<iconset resource="../../../libs/vmisc/share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>752</width>
<height>650</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QGroupBox" name="groupBoxPaperFormat">
<property name="autoFillBackground">
@ -308,8 +321,6 @@
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QGroupBox" name="groupBoxText">
<property name="title">
@ -329,8 +340,6 @@
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@ -621,10 +630,25 @@
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">

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);