diff --git a/GUI/Model/Beam/BeamDistributionItem.h b/GUI/Model/Beam/BeamDistributionItem.h index 59c0ce568da8946b6f39268cdda8362e427fcc60..fb7eb4b47fe16186492c5e6bd691ef910717c234 100644 --- a/GUI/Model/Beam/BeamDistributionItem.h +++ b/GUI/Model/Beam/BeamDistributionItem.h @@ -42,8 +42,6 @@ public: SelectionProperty<DistributionItemCatalog>& distributionSelection() { return m_distribution; } bool expandGroupBox = true; - bool isExpandGroupBox() const { return expandGroupBox; } - void setExpandGroupBox(bool b) { expandGroupBox = b; } virtual std::unique_ptr<IDistribution1D> createDistribution1D() const; diff --git a/GUI/View/Instrument/AlphaScanEditor.cpp b/GUI/View/Instrument/AlphaScanEditor.cpp index 62222a2d651ae795b290d72100f1aaacca1bf770..6a0b791ea9022b8493ac44dda01ba96b9da52d61 100644 --- a/GUI/View/Instrument/AlphaScanEditor.cpp +++ b/GUI/View/Instrument/AlphaScanEditor.cpp @@ -67,10 +67,7 @@ AlphaScanEditor::AlphaScanEditor(QWidget* parent, GrazingScanItem* item, bool al hLayout->setAlignment(m_plot, Qt::AlignTop); hLayout->addStretch(1); - auto* collapser = GroupBoxCollapser::installIntoGroupBox(this); - collapser->setExpanded(item->isExpandGroupBox()); - connect(collapser, &GroupBoxCollapser::toggled, this, - [item](bool b) { item->setExpandGroupBox(b); }); + GroupBoxCollapser::installIntoGroupBox(this, item->expandGroupBox); updatePlot(); } diff --git a/GUI/View/Instrument/DistributionEditor.cpp b/GUI/View/Instrument/DistributionEditor.cpp index 9cceb20254f30a05a316bdc43283dd7668f0ec43..0673bb7833e7c80b578bb4afbb8f2712157204a0 100644 --- a/GUI/View/Instrument/DistributionEditor.cpp +++ b/GUI/View/Instrument/DistributionEditor.cpp @@ -176,10 +176,7 @@ DistributionEditor::DistributionEditor(const QString& title, hLayout->addWidget(m_plot); hLayout->addStretch(1); - auto* collapser = GroupBoxCollapser::installIntoGroupBox(this); - collapser->setExpanded(item->isExpandGroupBox()); - connect(collapser, &GroupBoxCollapser::toggled, this, - [item](bool b) { item->setExpandGroupBox(b); }); + GroupBoxCollapser::installIntoGroupBox2(this, item->expandGroupBox); connect(m_selector, &DistributionSelector::distributionChanged, this, &DistributionEditor::distributionChanged);