From 655adddbad3cc88a81d3fc892b9436f06273c864 Mon Sep 17 00:00:00 2001
From: Mikhail Svechnikov <m.svechnikov@fz-juelich.de>
Date: Thu, 9 Nov 2023 16:00:54 +0100
Subject: [PATCH] make AxisPropertyForm non-collapsible

---
 GUI/Model/Descriptor/AxisProperty.cpp | 14 ++------------
 GUI/Model/Descriptor/AxisProperty.h   |  2 --
 GUI/View/Device/AxisPropertyForm.cpp  |  2 +-
 GUI/View/Device/AxisPropertyForm.h    |  2 +-
 4 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/GUI/Model/Descriptor/AxisProperty.cpp b/GUI/Model/Descriptor/AxisProperty.cpp
index a485d191a68..b0ed1ed4f75 100644
--- a/GUI/Model/Descriptor/AxisProperty.cpp
+++ b/GUI/Model/Descriptor/AxisProperty.cpp
@@ -22,7 +22,7 @@ namespace Tag {
 const QString Nbins("Nbins");
 const QString Min("Min");
 const QString Max("Max");
-const QString ExpandGroupbox("ExpandGroupbox");
+const QString ExpandGroupbox("ExpandGroupbox"); // obsolete since v22.0
 
 } // namespace Tag
 } // namespace
@@ -50,7 +50,7 @@ Scale AxisProperty::createAxis(const std::string& name) const
 
 void AxisProperty::writeTo(QXmlStreamWriter* w) const
 {
-    XML::writeAttribute(w, XML::Attrib::version, uint(1));
+    XML::writeAttribute(w, XML::Attrib::version, uint(2));
 
     // nbins
     w->writeStartElement(Tag::Nbins);
@@ -66,11 +66,6 @@ void AxisProperty::writeTo(QXmlStreamWriter* w) const
     w->writeStartElement(Tag::Max);
     m_max.writeTo(w);
     w->writeEndElement();
-
-    // groupbox: is expanded?
-    w->writeStartElement(Tag::ExpandGroupbox);
-    XML::writeAttribute(w, XML::Attrib::value, expandGroupBox);
-    w->writeEndElement();
 }
 
 void AxisProperty::readFrom(QXmlStreamReader* r)
@@ -96,11 +91,6 @@ void AxisProperty::readFrom(QXmlStreamReader* r)
             m_max.readFrom(r);
             XML::gotoEndElementOfTag(r, tag);
 
-            // groupbox: is expanded?
-        } else if (tag == Tag::ExpandGroupbox) {
-            XML::readAttribute(r, XML::Attrib::value, &expandGroupBox);
-            XML::gotoEndElementOfTag(r, tag);
-
         } else
             r->skipCurrentElement();
     }
diff --git a/GUI/Model/Descriptor/AxisProperty.h b/GUI/Model/Descriptor/AxisProperty.h
index 83d51747c00..b9ac1b5d40d 100644
--- a/GUI/Model/Descriptor/AxisProperty.h
+++ b/GUI/Model/Descriptor/AxisProperty.h
@@ -54,8 +54,6 @@ public:
     uint nbins() const { return m_nbins; }
     void setNbins(uint v) { m_nbins = v; }
 
-    bool expandGroupBox = true;
-
     void writeTo(QXmlStreamWriter* w) const;
     void readFrom(QXmlStreamReader* r);
 
diff --git a/GUI/View/Device/AxisPropertyForm.cpp b/GUI/View/Device/AxisPropertyForm.cpp
index 88fb2fdce29..0cfcdee3f8f 100644
--- a/GUI/View/Device/AxisPropertyForm.cpp
+++ b/GUI/View/Device/AxisPropertyForm.cpp
@@ -20,7 +20,7 @@
 
 AxisPropertyForm::AxisPropertyForm(QWidget* parent, const QString& groupTitle,
                                    AxisProperty* axisProperty, QString nbinsTooltip)
-    : CollapsibleGroupBox(groupTitle, parent, axisProperty->expandGroupBox)
+    : StaticGroupBox(groupTitle, parent)
     , m_axisProperty(axisProperty)
 {
     auto* layout = new QFormLayout;
diff --git a/GUI/View/Device/AxisPropertyForm.h b/GUI/View/Device/AxisPropertyForm.h
index caf626f9ed1..1fa69b0c215 100644
--- a/GUI/View/Device/AxisPropertyForm.h
+++ b/GUI/View/Device/AxisPropertyForm.h
@@ -26,7 +26,7 @@ class QSpinBox;
 //! An AxisProperty handles values for a EquiDivision. The values will be already written into the
 //! data element. For each change of values, a signal will be emitted. Use this e.g. to update
 //! dependent values or to set the document to modified.
-class AxisPropertyForm : public CollapsibleGroupBox {
+class AxisPropertyForm : public StaticGroupBox {
     Q_OBJECT
 public:
     AxisPropertyForm(QWidget* parent, const QString& groupTitle, AxisProperty* axisProperty,
-- 
GitLab