diff --git a/GUI/Model/Sample/LayerItem.cpp b/GUI/Model/Sample/LayerItem.cpp index 540a95e53dc2779e5fe80a7a2edb265af0cd2ee9..5867651ae508085f2e0696b1c79184f2a9fa2b20 100644 --- a/GUI/Model/Sample/LayerItem.cpp +++ b/GUI/Model/Sample/LayerItem.cpp @@ -34,6 +34,7 @@ const QString Thickness("Thickness"); const QString Roughness("Roughness"); const QString Layout("Layout"); const QString ExpandLayerGroupbox("ExpandLayerGroupbox"); +const QString ExpandRoughnessGroupbox("ExpandRoughnessGroupbox"); } // namespace Tag @@ -118,6 +119,7 @@ void LayerItem::writeTo(QXmlStreamWriter* w) const for (const auto* layout : m_layouts) XML::writeTaggedElement(w, Tag::Layout, *layout); XML::writeTaggedValue(w, Tag::ExpandLayerGroupbox, expandLayer); + XML::writeTaggedValue(w, Tag::ExpandRoughnessGroupbox, expandRoughness); } void LayerItem::readFrom(QXmlStreamReader* r) @@ -139,6 +141,8 @@ void LayerItem::readFrom(QXmlStreamReader* r) XML::readTaggedElement(r, tag, *addLayoutItem()); else if (tag == Tag::ExpandLayerGroupbox) expandLayer = XML::readTaggedBool(r, tag); + else if (tag == Tag::ExpandRoughnessGroupbox) + expandRoughness = XML::readTaggedBool(r, tag); else r->skipCurrentElement(); } diff --git a/GUI/Model/Sample/LayerItem.h b/GUI/Model/Sample/LayerItem.h index 28649fcb8176c4951d175fdfd0e97d130208f54b..40a93d217197d9305d9966c7f96d808a62ed51f6 100644 --- a/GUI/Model/Sample/LayerItem.h +++ b/GUI/Model/Sample/LayerItem.h @@ -61,6 +61,7 @@ public: void readFrom(QXmlStreamReader* r); bool expandLayer = false; + bool expandRoughness = true; private: uint m_num_slices = 1; diff --git a/GUI/View/Sample/LayerForm.cpp b/GUI/View/Sample/LayerForm.cpp index 239615053552ffb6865d87463ca3536810cd0f31..47463750fe4e8028cbe9afd4ca5b55c5f22119d8 100644 --- a/GUI/View/Sample/LayerForm.cpp +++ b/GUI/View/Sample/LayerForm.cpp @@ -113,7 +113,8 @@ LayerForm::LayerForm(QWidget* parent, LayerItem* layerItem, SampleEditorControll "when corresponding simulation option is set.")); // m_layout->addSelection(m_layer->roughnessSelection()); - m_layout->addRow(new RoughnessForm(this, m_layer->roughnessSelection(), m_ec)); + m_layout->addRow( + new RoughnessForm(this, m_layer->roughnessSelection(), m_layer->expandRoughness, m_ec)); m_roughness_row = m_layout->rowCount() - 1; // -- layouts diff --git a/GUI/View/Sample/RoughnessForm.cpp b/GUI/View/Sample/RoughnessForm.cpp index 467153dbba2daf29c3a2803718cb04a00d650a56..b1fef4297dbaa7f2d9ffd2b44b62c5f0b35c0375 100644 --- a/GUI/View/Sample/RoughnessForm.cpp +++ b/GUI/View/Sample/RoughnessForm.cpp @@ -19,7 +19,7 @@ RoughnessForm::RoughnessForm(QWidget* parent, PolyPtr<RoughnessItem, RoughnessCatalog>& roughnessSelection, - SampleEditorController* ec) + bool& expandRoughness, SampleEditorController* ec) : CollapsibleGroupBox(parent, expandRoughness) , m_cb(new QComboBox(this)) , m_rs(roughnessSelection) diff --git a/GUI/View/Sample/RoughnessForm.h b/GUI/View/Sample/RoughnessForm.h index 660cb2dcf1db1e009032017e72081c1e6f7c3679..e15fd9309615464c15aa812b90683c44a567e1be 100644 --- a/GUI/View/Sample/RoughnessForm.h +++ b/GUI/View/Sample/RoughnessForm.h @@ -27,7 +27,7 @@ class SampleEditorController; class RoughnessForm : public CollapsibleGroupBox { public: RoughnessForm(QWidget* parent, PolyPtr<RoughnessItem, RoughnessCatalog>& roughnessSelection, - SampleEditorController* ec); + bool& expandRoughness, SampleEditorController* ec); void onRoughnessTypeChanged(); @@ -38,8 +38,6 @@ private: HeinzFormLayout* m_layout; QComboBox* m_cb; PolyPtr<RoughnessItem, RoughnessCatalog>& m_rs; - - bool expandRoughness = true; }; #endif // BORNAGAIN_GUI_VIEW_SAMPLE_ROUGHNESSFORM_H