Skip to content
Snippets Groups Projects
Commit 3909cac4 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

save collapsed state

parent 7c58118d
No related branches found
No related tags found
1 merge request!2703Allow changing roughness height statistics in GUI
......@@ -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();
}
......
......@@ -61,6 +61,7 @@ public:
void readFrom(QXmlStreamReader* r);
bool expandLayer = false;
bool expandRoughness = true;
private:
uint m_num_slices = 1;
......
......@@ -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
......
......@@ -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)
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment