--User changes

-Attempt to preserve xaos when adding xforms. Note this is not an exact copy, but just a preservation of some values based on position.
 -Add some acceleration to the changing of spinner values when dragging the right mouse button to adjust.
 -Make the pivot be the center of the viewable area when doing drag/rotate/scale with the right mouse button.
 --Clamp minimum scale to 10
 --Draw a line from the mouse position to the pivot.
 -Keep a cache of the last added final xform with each flame so that it can be quickly added, removed, then added back for testing its effect.
 --This is not saved with the xml file and is solely for interactive editing.

--Bug fixes
 -File filtering in open and save dialogs were broken.
 -Right clicking on integer spin boxes was causing the context menu to pop up, when it should be supressed just like double spin boxes.
 -Deleting xforms was still broken.

--Code changes
 -Refactor the code for adding and pasting xforms into a single global static function called AddXformsWithXaos().
This commit is contained in:
Person
2018-08-10 18:06:04 -07:00
parent 26c558a2f5
commit dee4304bf2
13 changed files with 173 additions and 62 deletions

View File

@ -601,7 +601,7 @@ QStringList Fractorium::SetupOpenXmlDialog()
connect(m_FileDialog, &QFileDialog::filterSelected, [&](const QString & filter) { m_Settings->OpenXmlExt(filter); });
m_FileDialog->setFileMode(QFileDialog::ExistingFiles);
m_FileDialog->setAcceptMode(QFileDialog::AcceptOpen);
m_FileDialog->setNameFilter("*.flam3;;*.flame;;*.xml");
m_FileDialog->setNameFilter("Flam3 (*.flam3);;Flame (*.flame);;Xml (*.xml)");
m_FileDialog->setWindowTitle("Open Flame");
m_FileDialog->setDirectory(m_Settings->OpenFolder());
m_FileDialog->selectNameFilter(m_Settings->OpenXmlExt());
@ -616,7 +616,7 @@ QStringList Fractorium::SetupOpenXmlDialog()
#else
auto defaultFilter(m_Settings->OpenXmlExt());
auto filenames = QFileDialog::getOpenFileNames(this, tr("Open Flame"), m_Settings->OpenFolder(), tr("Flame Files (*.flam3 *.flame *.xml)"), &defaultFilter);
auto filenames = QFileDialog::getOpenFileNames(this, tr("Open Flame"), m_Settings->OpenFolder(), tr("Flam3(*.flam3);; Flame(*.flame);; Xml(*.xml)"), &defaultFilter);
m_Settings->OpenXmlExt(defaultFilter);
if (!filenames.empty())
@ -655,7 +655,7 @@ QString Fractorium::SetupSaveXmlDialog(const QString& defaultFilename)
//This is most likely a bug in QFileDialog.
m_FileDialog->setAcceptMode(QFileDialog::AcceptSave);
m_FileDialog->selectFile(defaultFilename);
m_FileDialog->setNameFilter(".flam3;;.flame;;.xml");
m_FileDialog->setNameFilter("Flam3 (*.flam3);;Flame (*.flame);;Xml (*.xml)");
m_FileDialog->setWindowTitle("Save flame as xml");
m_FileDialog->setDirectory(m_Settings->SaveFolder());
m_FileDialog->selectNameFilter(m_Settings->SaveXmlExt());