diff --git a/GUI/View/SampleDesigner/CompoundForm.cpp b/GUI/View/SampleDesigner/CompoundForm.cpp index ef3b9a64e297989bf02f2353be77b6b4daed1918..9ae2b4c8754aeebfc9b9db35e96f4167980d3ec8 100644 --- a/GUI/View/SampleDesigner/CompoundForm.cpp +++ b/GUI/View/SampleDesigner/CompoundForm.cpp @@ -15,7 +15,7 @@ #include "GUI/View/SampleDesigner/CompoundForm.h" #include "GUI/Model/Sample/CompoundItem.h" #include "GUI/Support/Util/ActionFactory.h" -#include "GUI/View/SampleDesigner/FormLayouter.h" +#include "GUI/View/SampleDesigner/HeinzFormLayout.h" #include "GUI/View/SampleDesigner/LayerEditorUtil.h" #include <QAction> #include <QPushButton> @@ -26,15 +26,15 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd , m_compositionItem(compoundItem) , m_ec(ec) { - FormLayouter layouter(this, ec); - layouter.setContentsMargins(30, 6, 0, 0); - layouter.addVector(compoundItem->position(), false); - layouter.addSelection(compoundItem->rotationSelection()); - layouter.addValue(compoundItem->abundance()); - body()->setLayout(layouter.layout()); + m_layout = new HeinzFormLayout(this, ec); + body()->setLayout(m_layout); + m_layout->setContentsMargins(30, 6, 0, 0); + m_layout->addVector(compoundItem->position(), false); + m_layout->addSelection(compoundItem->rotationSelection()); + m_layout->addValue(compoundItem->abundance()); for (auto* particle : compoundItem->itemsWithParticles()) - layouter.addRow( + m_layout->addRow( LayerEditorUtil::createWidgetForItemWithParticles(this, particle, false, ec)); auto* btn = LayerEditorUtil::createAddParticleButton( @@ -42,7 +42,7 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd [=](ItemWithParticlesCatalog::Type type) { ec->addCompoundItem(compoundItem, type); }); m_structureEditingWidgets << btn; - layouter.addStructureEditingRow(btn); + m_layout->addStructureEditingRow(btn); // top right corner actions // show in real space @@ -67,8 +67,6 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd if (allowRemove) addTitleAction(m_removeAction); } - - m_layout = layouter.layout(); } CompoundForm::~CompoundForm() = default; diff --git a/GUI/View/SampleDesigner/CompoundForm.h b/GUI/View/SampleDesigner/CompoundForm.h index 642b33a04e9aa81bdd1af0855fd2224501badda2..e4deb6fc631ea82835f8ec99dc0cc906f0c63262 100644 --- a/GUI/View/SampleDesigner/CompoundForm.h +++ b/GUI/View/SampleDesigner/CompoundForm.h @@ -16,9 +16,9 @@ #define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_COMPOUNDFORM_H #include "GUI/View/Widget/GroupBoxes.h" -#include <QFormLayout> class CompoundItem; +class HeinzFormLayout; class ItemWithParticles; class SampleEditorController; @@ -36,7 +36,7 @@ public: void onAboutToRemoveParticle(ItemWithParticles* item); private: - QFormLayout* m_layout; + HeinzFormLayout* m_layout; CompoundItem* m_compositionItem; QAction* m_removeAction = nullptr; QAction* m_duplicateAction = nullptr;