Skip to content
Snippets Groups Projects
Commit ba4ffc95 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

GroupBoxCollapser: sort blocks

parent afc6f05e
No related branches found
No related tags found
1 merge request!2058GUI instrument editor: detector section made more compact
......@@ -79,17 +79,6 @@ void GroupBoxCollapser::setExpanded(bool expanded)
GroupBoxCollapser::GroupBoxCollapser(QGroupBox* groupBox)
: QObject(groupBox)
{
auto* mainLayout = new QVBoxLayout;
mainLayout->setSpacing(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
m_contentArea = new QWidget(groupBox);
m_contentArea->setObjectName("ContentArea");
m_contentArea->setLayout(groupBox->layout());
mainLayout->addWidget(m_contentArea);
groupBox->setLayout(mainLayout);
m_toggleButton = new QToolButton(groupBox);
m_toggleButton->setObjectName("GroupBoxToggler");
if (appSettings->currentStyle() == ApplicationSettings::Style::native)
......@@ -113,8 +102,18 @@ GroupBoxCollapser::GroupBoxCollapser(QGroupBox* groupBox)
m_titleWidget->setAttribute(Qt::WA_StyledBackground, true);
m_titleWidget->setLayout(m_titleLayout);
groupBox->layout()->setMenuBar(m_titleWidget);
groupBox->setTitle("");
m_contentArea = new QWidget(groupBox);
m_contentArea->setObjectName("ContentArea");
m_contentArea->setLayout(groupBox->layout());
auto* mainLayout = new QVBoxLayout;
mainLayout->setSpacing(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setMenuBar(m_titleWidget);
mainLayout->addWidget(m_contentArea);
groupBox->setTitle(""); // title has been read above
groupBox->setLayout(mainLayout); // overwrites layout that has been read above
connect(m_toggleButton, &QAbstractButton::clicked, this, &GroupBoxCollapser::toggle,
Qt::UniqueConnection);
......
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