mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Make sure all groups have a new layout inside as well
This commit is contained in:
parent
94a8c35311
commit
ffaeccf31c
@ -328,7 +328,6 @@ QMinimizePanel*
|
||||
{
|
||||
QString groupBoxKey = group->keyword();
|
||||
QMinimizePanel* groupBox = nullptr;
|
||||
QGridLayout* groupBoxLayout = nullptr;
|
||||
|
||||
// Find or create groupBox
|
||||
std::map<QString, QPointer<QMinimizePanel>>::iterator it;
|
||||
@ -340,18 +339,6 @@ QMinimizePanel*
|
||||
groupBox->enableFrame(group->enableFrame());
|
||||
groupBox->setTitle(group->uiName(uiConfigName));
|
||||
groupBox->setObjectName(group->keyword());
|
||||
groupBoxLayout = new QGridLayout();
|
||||
|
||||
if (!group->enableFrame())
|
||||
{
|
||||
groupBoxLayout->setContentsMargins(0, 0, 0, 0);
|
||||
groupBoxLayout->setHorizontalSpacing(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
groupBoxLayout->setContentsMargins(6, 6, 6, 6);
|
||||
}
|
||||
groupBox->contentFrame()->setLayout(groupBoxLayout);
|
||||
connect(groupBox, SIGNAL(expandedChanged(bool)), this, SLOT(groupBoxExpandedStateToggled(bool)));
|
||||
|
||||
m_newGroupBoxes[groupBoxKey] = groupBox;
|
||||
@ -360,10 +347,17 @@ QMinimizePanel*
|
||||
{
|
||||
groupBox = it->second;
|
||||
CAF_ASSERT(groupBox);
|
||||
|
||||
m_newGroupBoxes[groupBoxKey] = groupBox;
|
||||
}
|
||||
|
||||
QMargins contentMargins;
|
||||
if (group->enableFrame())
|
||||
{
|
||||
contentMargins = QMargins(6, 6, 6, 6);
|
||||
}
|
||||
|
||||
ensureWidgetContainsEmptyGridLayout(groupBox->contentFrame(), contentMargins);
|
||||
|
||||
// Set Expanded state
|
||||
bool isExpanded = isUiGroupExpanded(group);
|
||||
groupBox->setExpanded(isExpanded);
|
||||
@ -419,7 +413,7 @@ caf::PdmUiFieldEditorHandle* caf::PdmUiFormLayoutObjectEditor::findOrCreateField
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void caf::PdmUiFormLayoutObjectEditor::ensureWidgetContainsEmptyGridLayout(QWidget* containerWidget)
|
||||
void caf::PdmUiFormLayoutObjectEditor::ensureWidgetContainsEmptyGridLayout(QWidget* containerWidget, QMargins contentMargins)
|
||||
{
|
||||
CAF_ASSERT(containerWidget);
|
||||
QLayout* layout = containerWidget->layout();
|
||||
@ -435,7 +429,7 @@ void caf::PdmUiFormLayoutObjectEditor::ensureWidgetContainsEmptyGridLayout(QWidg
|
||||
}
|
||||
|
||||
QGridLayout* gridLayout = new QGridLayout;
|
||||
gridLayout->setContentsMargins(0, 0, 0, 0);
|
||||
gridLayout->setContentsMargins(contentMargins);
|
||||
containerWidget->setLayout(gridLayout);
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ protected:
|
||||
QMinimizePanel* findOrCreateGroupBox(QWidget* parent, PdmUiGroup* group, const QString& uiConfigName);
|
||||
PdmUiFieldEditorHandle* findOrCreateFieldEditor(QWidget* parent, PdmUiFieldHandle* field, const QString& uiConfigName);
|
||||
|
||||
static void ensureWidgetContainsEmptyGridLayout(QWidget* containerWidget);
|
||||
static void ensureWidgetContainsEmptyGridLayout(QWidget* containerWidget, QMargins contentMargins = QMargins());
|
||||
|
||||
private slots:
|
||||
void groupBoxExpandedStateToggled(bool isExpanded);
|
||||
|
Loading…
Reference in New Issue
Block a user