1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

Merge pull request #1507 from srcejon/rollup_min_width

Set window width to account for minimum width required for visible rollups
This commit is contained in:
Edouard Griffiths 2022-11-08 17:01:22 +01:00 committed by GitHub
commit b551a20302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 167 additions and 147 deletions

View File

@ -467,7 +467,8 @@ void ChannelAnalyzerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -369,19 +369,6 @@ void AISDemodGUI::filter()
void AISDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) void AISDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{ {
if (widget == ui->scopeContainer)
{
if (rollDown)
{
// Make wide enough for scope controls
setMinimumWidth(716);
}
else
{
setMinimumWidth(352);
}
}
RollupContents *rollupContents = getRollupContents(); RollupContents *rollupContents = getRollupContents();
if (rollupContents->hasExpandableWidgets()) { if (rollupContents->hasExpandableWidgets()) {
@ -391,7 +378,8 @@ void AISDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -721,10 +721,16 @@
<rect> <rect>
<x>20</x> <x>20</x>
<y>400</y> <y>400</y>
<width>351</width> <width>716</width>
<height>341</height> <height>341</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>714</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Waveforms</string> <string>Waveforms</string>
</property> </property>
@ -911,11 +917,6 @@
</widget> </widget>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget> <customwidget>
<class>RollupContents</class> <class>RollupContents</class>
<extends>QWidget</extends> <extends>QWidget</extends>
@ -923,10 +924,9 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>ValueDialZ</class> <class>ButtonSwitch</class>
<extends>QWidget</extends> <extends>QToolButton</extends>
<header>gui/valuedialz.h</header> <header>gui/buttonswitch.h</header>
<container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>LevelMeterSignalDB</class> <class>LevelMeterSignalDB</class>
@ -934,6 +934,12 @@
<header>gui/levelmeter.h</header> <header>gui/levelmeter.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>GLScope</class> <class>GLScope</class>
<extends>QWidget</extends> <extends>QWidget</extends>

View File

@ -556,7 +556,8 @@ void APTDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -325,7 +325,8 @@ void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -18,7 +18,7 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>642</width> <width>450</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -48,7 +48,7 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>640</width> <width>450</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -553,7 +553,7 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>640</width> <width>760</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>

View File

@ -338,7 +338,8 @@ void ChirpChatDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -401,7 +401,8 @@ void DABDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -257,7 +257,8 @@ void FreeDVDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -383,7 +383,8 @@ void PacketDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -418,19 +418,6 @@ void PagerDemodGUI::filter()
void PagerDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) void PagerDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{ {
if (widget == ui->scopeContainer)
{
if (rollDown)
{
// Make wide enough for scope controls
setMinimumWidth(716);
}
else
{
setMinimumWidth(352);
}
}
RollupContents *rollupContents = getRollupContents(); RollupContents *rollupContents = getRollupContents();
if (rollupContents->hasExpandableWidgets()) { if (rollupContents->hasExpandableWidgets()) {
@ -440,7 +427,8 @@ void PagerDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -816,10 +816,16 @@
<rect> <rect>
<x>20</x> <x>20</x>
<y>400</y> <y>400</y>
<width>351</width> <width>714</width>
<height>341</height> <height>341</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>714</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Waveforms</string> <string>Waveforms</string>
</property> </property>
@ -1019,10 +1025,9 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>ValueDialZ</class> <class>ButtonSwitch</class>
<extends>QWidget</extends> <extends>QToolButton</extends>
<header>gui/valuedialz.h</header> <header>gui/buttonswitch.h</header>
<container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>LevelMeterSignalDB</class> <class>LevelMeterSignalDB</class>
@ -1031,9 +1036,10 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>ButtonSwitch</class> <class>ValueDialZ</class>
<extends>QToolButton</extends> <extends>QWidget</extends>
<header>gui/buttonswitch.h</header> <header>gui/valuedialz.h</header>
<container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>GLScope</class> <class>GLScope</class>

View File

@ -475,19 +475,6 @@ void RadiosondeDemodGUI::filter()
void RadiosondeDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) void RadiosondeDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{ {
if (widget == ui->scopeContainer)
{
if (rollDown)
{
// Make wide enough for scope controls
setMinimumWidth(716);
}
else
{
setMinimumWidth(352);
}
}
RollupContents *rollupContents = getRollupContents(); RollupContents *rollupContents = getRollupContents();
if (rollupContents->hasExpandableWidgets()) { if (rollupContents->hasExpandableWidgets()) {
@ -497,7 +484,8 @@ void RadiosondeDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -855,10 +855,16 @@
<rect> <rect>
<x>20</x> <x>20</x>
<y>400</y> <y>400</y>
<width>351</width> <width>714</width>
<height>341</height> <height>341</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>714</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Waveforms</string> <string>Waveforms</string>
</property> </property>
@ -1061,10 +1067,9 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>ValueDialZ</class> <class>ButtonSwitch</class>
<extends>QWidget</extends> <extends>QToolButton</extends>
<header>gui/valuedialz.h</header> <header>gui/buttonswitch.h</header>
<container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>LevelMeterSignalDB</class> <class>LevelMeterSignalDB</class>
@ -1073,9 +1078,10 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>ButtonSwitch</class> <class>ValueDialZ</class>
<extends>QToolButton</extends> <extends>QWidget</extends>
<header>gui/buttonswitch.h</header> <header>gui/valuedialz.h</header>
<container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>GLScope</class> <class>GLScope</class>

View File

@ -316,19 +316,15 @@ void SSBDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
RollupContents *rollupContents = getRollupContents(); RollupContents *rollupContents = getRollupContents();
if (rollupContents->hasExpandableWidgets()) if (rollupContents->hasExpandableWidgets()) {
{
qDebug("SSBDemodGUI::onWidgetRolled: set vertical policy expanding");
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding); setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
} } else {
else
{
qDebug("SSBDemodGUI::onWidgetRolled: set vertical policy fixed");
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed); setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -1116,7 +1116,8 @@ void VORDemodMCGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -364,7 +364,8 @@ void FileSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -40,6 +40,12 @@
<height>151</height> <height>151</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Settings</string> <string>Settings</string>
</property> </property>
@ -814,6 +820,17 @@
<header>gui/rollupcontents.h</header> <header>gui/rollupcontents.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>LevelMeterSignalDB</class>
<extends>QWidget</extends>
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>GLSpectrum</class> <class>GLSpectrum</class>
<extends>QWidget</extends> <extends>QWidget</extends>
@ -832,17 +849,6 @@
<header>gui/valuedialz.h</header> <header>gui/valuedialz.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>LevelMeterSignalDB</class>
<extends>QWidget</extends>
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../../../sdrgui/resources/res.qrc"/> <include location="../../../sdrgui/resources/res.qrc"/>

View File

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -42,10 +42,16 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>10</y> <y>10</y>
<width>301</width> <width>302</width>
<height>91</height> <height>91</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>302</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Settings</string> <string>Settings</string>
</property> </property>

View File

@ -546,7 +546,8 @@ void NoiseFigureGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -1915,7 +1915,8 @@ void RadioAstronomyGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -209,19 +209,6 @@ void RadioClockGUI::on_timezone_currentIndexChanged(int index)
void RadioClockGUI::onWidgetRolled(QWidget* widget, bool rollDown) void RadioClockGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{ {
if (widget == ui->scopeContainer)
{
if (rollDown)
{
// Make wide enough for scope controls
setMinimumWidth(716);
}
else
{
setMinimumWidth(352);
}
}
RollupContents *rollupContents = getRollupContents(); RollupContents *rollupContents = getRollupContents();
if (rollupContents->hasExpandableWidgets()) { if (rollupContents->hasExpandableWidgets()) {
@ -231,7 +218,8 @@ void RadioClockGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -591,10 +591,16 @@
<rect> <rect>
<x>20</x> <x>20</x>
<y>250</y> <y>250</y>
<width>351</width> <width>714</width>
<height>341</height> <height>341</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>714</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Waveforms</string> <string>Waveforms</string>
</property> </property>
@ -643,18 +649,18 @@
<header>gui/rollupcontents.h</header> <header>gui/rollupcontents.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>LevelMeterSignalDB</class> <class>LevelMeterSignalDB</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>gui/levelmeter.h</header> <header>gui/levelmeter.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>GLScope</class> <class>GLScope</class>
<extends>QWidget</extends> <extends>QWidget</extends>

View File

@ -24,7 +24,7 @@
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>360</width> <width>560</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -45,6 +45,12 @@
<height>141</height> <height>141</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>334</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Settings</string> <string>Settings</string>
</property> </property>
@ -447,6 +453,12 @@
</widget> </widget>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>ValueDialZ</class> <class>ValueDialZ</class>
<extends>QWidget</extends> <extends>QWidget</extends>
@ -459,12 +471,6 @@
<header>gui/valuedial.h</header> <header>gui/valuedial.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../../../sdrgui/resources/res.qrc"/> <include location="../../../sdrgui/resources/res.qrc"/>

View File

@ -356,7 +356,8 @@ void SigMFFileSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -609,7 +609,8 @@ void UDPSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -329,7 +329,8 @@ void IEEE_802_15_4_ModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -352,7 +352,8 @@ void AISModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -304,7 +304,8 @@ void FreeDVModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -389,7 +389,8 @@ void PacketModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -368,7 +368,8 @@ void SSBModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -491,7 +491,8 @@ void UDPSourceGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -176,7 +176,8 @@ void AISGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -120,7 +120,8 @@ void AntennaToolsGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -135,7 +135,8 @@ void DemodAnalyzerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -127,7 +127,8 @@ void RadiosondeGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -239,7 +239,8 @@ void SatelliteTrackerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -234,7 +234,8 @@ void StarTrackerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -807,7 +807,8 @@ void VORLocalizerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
} }
int h = rollupContents->height() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);
applySettings(); applySettings();

View File

@ -97,6 +97,7 @@ protected:
void updateIndexLabel(); void updateIndexLabel();
int getAdditionalHeight() const { return 22 + 22; } // height of top and bottom bars int getAdditionalHeight() const { return 22 + 22; } // height of top and bottom bars
void setHighlighted(bool highlighted); void setHighlighted(bool highlighted);
int gripSize() { return m_resizer.m_gripSize; } // size in pixels of resize grip around the window
DeviceType m_deviceType; DeviceType m_deviceType;
int m_deviceSetIndex; int m_deviceSetIndex;

View File

@ -74,6 +74,7 @@ protected:
void mouseMoveEvent(QMouseEvent* event) override; void mouseMoveEvent(QMouseEvent* event) override;
void resetContextMenuType() { m_contextMenuType = ContextMenuNone; } void resetContextMenuType() { m_contextMenuType = ContextMenuNone; }
int getAdditionalHeight() const { return 22 + 22; } // height of top and bottom bars int getAdditionalHeight() const { return 22 + 22; } // height of top and bottom bars
int gripSize() { return m_resizer.m_gripSize; } // size in pixels of resize grip around the window
Feature *m_feature; Feature *m_feature;
int m_featureIndex; int m_featureIndex;

View File

@ -95,11 +95,11 @@ bool RollupContents::hasExpandableWidgets()
return false; return false;
} }
int RollupContents::arrangeRollups() int RollupContents::arrangeRollups()
{ {
QFontMetrics fm(font()); QFontMetrics fm(font());
int pos; int pos;
int minWidth = 0;
// First calculate minimum height needed, to determine how much extra space // First calculate minimum height needed, to determine how much extra space
// we have that can be split between expanding widgets // we have that can be split between expanding widgets
@ -123,12 +123,14 @@ int RollupContents::arrangeRollups()
} else { } else {
h = r->minimumSizeHint().height(); h = r->minimumSizeHint().height();
} }
minWidth = std::max(minWidth, r->minimumSize().width());
pos += h + 5; pos += h + 5;
} }
} }
} }
setMinimumHeight(pos); setMinimumHeight(pos);
setMinimumWidth(minWidth);
// Split extra space equally between widgets // Split extra space equally between widgets
// If there's a remainder, we give it to the first widget // If there's a remainder, we give it to the first widget