New option to control calling zoom current pattern piece by mouse double click.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-05-10 14:12:41 +03:00
parent e3cfd7a241
commit 1e0b777bd6
5 changed files with 30 additions and 2 deletions

View File

@ -108,6 +108,7 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
}); });
ui->checkBoxFreeCurve->setChecked(qApp->ValentinaSettings()->IsFreeCurveMode()); ui->checkBoxFreeCurve->setChecked(qApp->ValentinaSettings()->IsFreeCurveMode());
ui->checkBoxZoomFitBestCurrentPP->setChecked(qApp->ValentinaSettings()->IsDoubleClickZoomFitBestCurrentPP());
//----------------------- Toolbar //----------------------- Toolbar
ui->toolBarStyleCheck->setChecked(qApp->ValentinaSettings()->GetToolBarStyle()); ui->toolBarStyleCheck->setChecked(qApp->ValentinaSettings()->GetToolBarStyle());
@ -135,6 +136,7 @@ QStringList PreferencesConfigurationPage::Apply()
settings->SetOsSeparator(ui->osOptionCheck->isChecked()); settings->SetOsSeparator(ui->osOptionCheck->isChecked());
settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked()); settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked());
settings->SetFreeCurveMode(ui->checkBoxFreeCurve->isChecked()); settings->SetFreeCurveMode(ui->checkBoxFreeCurve->isChecked());
settings->SetDoubleClickZoomFitBestCurrentPP(ui->checkBoxZoomFitBestCurrentPP->isChecked());
if (m_langChanged || m_systemChanged) if (m_langChanged || m_systemChanged)
{ {

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>501</width> <width>501</width>
<height>582</height> <height>611</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -200,6 +200,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="checkBoxZoomFitBestCurrentPP">
<property name="text">
<string>Double click calls Zoom fit best for current pattern piece</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -63,6 +63,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationConfirmItemDeletion
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationConfirmFormatRewriting, (QLatin1String("configuration/confirm_format_rewriting"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationConfirmFormatRewriting, (QLatin1String("configuration/confirm_format_rewriting")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationToolBarStyle, (QLatin1String("configuration/tool_bar_style"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationToolBarStyle, (QLatin1String("configuration/tool_bar_style")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationFreeCurveMode, (QLatin1String("configuration/freeCurveMode"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationFreeCurveMode, (QLatin1String("configuration/freeCurveMode")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationDoubleClickZoomFitBestCurrentPP, (QLatin1String("configuration/doubleClickZoomFitBestCurrentPP")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternUndo, (QLatin1String("pattern/undo"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternUndo, (QLatin1String("pattern/undo")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternForbidFlipping, (QLatin1String("pattern/forbidFlipping"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternForbidFlipping, (QLatin1String("pattern/forbidFlipping")))
@ -524,6 +525,18 @@ void VCommonSettings::SetFreeCurveMode(bool value)
setValue(*settingConfigurationFreeCurveMode, value); setValue(*settingConfigurationFreeCurveMode, value);
} }
//---------------------------------------------------------------------------------------------------------------------
bool VCommonSettings::IsDoubleClickZoomFitBestCurrentPP() const
{
return value(*settingConfigurationDoubleClickZoomFitBestCurrentPP, 1).toBool();
}
//---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetDoubleClickZoomFitBestCurrentPP(bool value)
{
setValue(*settingConfigurationDoubleClickZoomFitBestCurrentPP, value);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
int VCommonSettings::GetUndoCount() const int VCommonSettings::GetUndoCount() const
{ {

View File

@ -102,6 +102,9 @@ public:
bool IsFreeCurveMode() const; bool IsFreeCurveMode() const;
void SetFreeCurveMode(bool value); void SetFreeCurveMode(bool value);
bool IsDoubleClickZoomFitBestCurrentPP() const;
void SetDoubleClickZoomFitBestCurrentPP(bool value);
int GetUndoCount() const; int GetUndoCount() const;
void SetUndoCount(const int &value); void SetUndoCount(const int &value);

View File

@ -607,7 +607,7 @@ void VMainGraphicsView::mouseReleaseEvent(QMouseEvent *event)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VMainGraphicsView::mouseDoubleClickEvent(QMouseEvent *event) void VMainGraphicsView::mouseDoubleClickEvent(QMouseEvent *event)
{ {
if (event->button() == Qt::LeftButton) if (event->button() == Qt::LeftButton && qApp->Settings()->IsDoubleClickZoomFitBestCurrentPP())
{ {
if (VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow())) if (VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow()))
{ {