diff --git a/GUI/View/SampleDesigner/LayerEditorUtil.cpp b/GUI/View/SampleDesigner/LayerEditorUtil.cpp index 7083a5384ccdb164a0325677ee0747770177339e..64b97ecfb91cfaf451e3f0aa69204b5fa4a91f9c 100644 --- a/GUI/View/SampleDesigner/LayerEditorUtil.cpp +++ b/GUI/View/SampleDesigner/LayerEditorUtil.cpp @@ -100,19 +100,6 @@ void LayerEditorUtil::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firs addSpacer); } -void LayerEditorUtil::addMagnetizationToGrid( - QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, - std::function<void(double, DoubleProperty&)> setNewValue, bool vertically, bool addSpacer, - bool with_z) -{ - if (with_z) - addMultiPropertyToGrid(m_gridLayout, firstCol, {&v.x(), &v.y(), &v.z()}, setNewValue, - vertically, addSpacer); - else - addMultiPropertyToGrid(m_gridLayout, firstCol, {&v.x(), &v.y()}, setNewValue, vertically, - addSpacer); -} - QWidget* LayerEditorUtil::createWidgetForItemWithParticles(QWidget* parentWidget, ItemWithParticles* itemWithParticles, bool allowAbundance, diff --git a/GUI/View/SampleDesigner/LayerEditorUtil.h b/GUI/View/SampleDesigner/LayerEditorUtil.h index 2f1c8601c07f84279a9bf35365057a1b90b7d37d..b9904a474d29ca8a4c4e0754b750ee9d81432c72 100644 --- a/GUI/View/SampleDesigner/LayerEditorUtil.h +++ b/GUI/View/SampleDesigner/LayerEditorUtil.h @@ -54,10 +54,6 @@ void addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol, const DoubleProperties& valueProperties, SampleEditorController* ec, bool addSpacer); -void addMagnetizationToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, - std::function<void(double, DoubleProperty&)> setNewValue, - bool vertically, bool addSpacer, bool with_z); - QWidget* createWidgetForItemWithParticles(QWidget* parentWidget, ItemWithParticles* itemWithParticles, bool allowAbundance, SampleEditorController* ec, bool allowRemove = true); diff --git a/GUI/View/SampleDesigner/MaterialInplaceForm.cpp b/GUI/View/SampleDesigner/MaterialInplaceForm.cpp index 62c3b389c70d5054953a1aaf08b8ed048ca72863..0844a698edd52251b70e99c7e86d7101bfb45bfc 100644 --- a/GUI/View/SampleDesigner/MaterialInplaceForm.cpp +++ b/GUI/View/SampleDesigner/MaterialInplaceForm.cpp @@ -120,12 +120,14 @@ void MaterialInplaceForm::createWidgets() // Processing z-magnetization is not implemented yet (see issue #654) const LayerItem* layer_item = dynamic_cast<LayerItem*>(m_item); + VectorProperty& v = material->magnetization(); if (layer_item && !layer_item->isTopLayer()) - LayerEditorUtil::addMagnetizationToGrid(m_layout, col, material->magnetization(), - setNewValue, true, false, false); + LayerEditorUtil::addMultiPropertyToGrid(m_layout, col, {&v.x(), &v.y()}, setNewValue, true, + false); + if (!layer_item) - LayerEditorUtil::addMagnetizationToGrid(m_layout, col, material->magnetization(), - setNewValue, true, false, true); + LayerEditorUtil::addMultiPropertyToGrid(m_layout, col, {&v.x(), &v.y(), &v.z()}, + setNewValue, true, false); // -- Create UI for material selection button auto* btn = new QPushButton("...", this);