Commit e812f094 authored by Johan Andruejol's avatar Johan Andruejol

ENH: Friendlier segment editor widget for better intergration in layouts

parent 3022a423
......@@ -211,7 +211,7 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
<height>100</height>
</size>
</property>
<property name="maximumSize">
......@@ -258,7 +258,7 @@
<item>
<widget class="QGroupBox" name="EffectsGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -274,7 +274,7 @@
<item>
<widget class="QGroupBox" name="OptionsGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -377,7 +377,7 @@
<item>
<widget class="ctkCollapsibleGroupBox" name="MaskingGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -468,19 +468,6 @@
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
......
......@@ -57,9 +57,9 @@
<item row="1" column="0">
<widget class="QTableWidget" name="SegmentsTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
......
......@@ -1633,14 +1633,11 @@ void qMRMLSegmentEditorWidget::updateEffectsSectionFromMRML()
d->MaskingGroupBox->show();
// Perform updates to prevent layout collapse
d->EffectHelpBrowser->setMinimumHeight(d->EffectHelpBrowser->sizeHint().height());
if (d->EffectHelpBrowser->layout())
{
d->EffectHelpBrowser->layout()->update();
}
activeEffect->optionsFrame()->setMinimumHeight(activeEffect->optionsFrame()->sizeHint().height());
activeEffect->optionsLayout()->activate();
this->setMinimumHeight(this->sizeHint().height());
}
else
{
......@@ -3269,21 +3266,16 @@ void qMRMLSegmentEditorWidget::updateEffectLayouts()
if (d->ActiveEffect)
{
d->EffectHelpBrowser->setMinimumHeight(d->EffectHelpBrowser->sizeHint().height());
if (d->EffectHelpBrowser->layout())
{
d->EffectHelpBrowser->layout()->update();
}
d->ActiveEffect->optionsFrame()->setMinimumHeight(d->ActiveEffect->optionsFrame()->sizeHint().height());
d->ActiveEffect->optionsLayout()->activate();
}
else
{
d->OptionsGroupBox->setMinimumHeight(d->OptionsGroupBox->sizeHint().height());
d->OptionsGroupBox->layout()->activate();
}
this->setMinimumHeight(this->sizeHint().height());
}
//-----------------------------------------------------------------------------
......
......@@ -60,6 +60,7 @@ class SegmentEditorWidget(ScriptedLoadableModuleWidget, VTKObservationMixin):
self.selectParameterNode()
self.editor.setMRMLScene(slicer.mrmlScene)
self.layout.addWidget(self.editor)
self.layout.addStretch()
# Observe editor effect registrations to make sure that any effects that are registered
# later will show up in the segment editor widget. For example, if Segment Editor is set
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment