Skip to content

Commit

Permalink
Set window width to account for miniumum width required for visible r…
Browse files Browse the repository at this point in the history
…ollups.
  • Loading branch information
srcejon committed Nov 8, 2022
1 parent fc2e5f5 commit ed27981
Show file tree
Hide file tree
Showing 42 changed files with 164 additions and 144 deletions.
3 changes: 2 additions & 1 deletion plugins/channelrx/chanalyzer/chanalyzergui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ void ChannelAnalyzerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
16 changes: 2 additions & 14 deletions plugins/channelrx/demodais/aisdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,19 +369,6 @@ void AISDemodGUI::filter()

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();

if (rollupContents->hasExpandableWidgets()) {
Expand All @@ -391,7 +378,8 @@ void AISDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
24 changes: 15 additions & 9 deletions plugins/channelrx/demodais/aisdemodgui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,16 @@
<rect>
<x>20</x>
<y>400</y>
<width>351</width>
<width>716</width>
<height>341</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>714</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Waveforms</string>
</property>
Expand Down Expand Up @@ -911,15 +917,21 @@
</widget>
</widget>
<customwidgets>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<class>LevelMeterSignalDB</class>
<extends>QWidget</extends>
<header>gui/rollupcontents.h</header>
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget>
Expand All @@ -928,12 +940,6 @@
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>LevelMeterSignalDB</class>
<extends>QWidget</extends>
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GLScope</class>
<extends>QWidget</extends>
Expand Down
3 changes: 2 additions & 1 deletion plugins/channelrx/demodapt/aptdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ void APTDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
3 changes: 2 additions & 1 deletion plugins/channelrx/demodbfm/bfmdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
6 changes: 3 additions & 3 deletions plugins/channelrx/demodbfm/bfmdemodgui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>642</width>
<width>450</width>
<height>0</height>
</size>
</property>
Expand Down Expand Up @@ -48,7 +48,7 @@
</property>
<property name="minimumSize">
<size>
<width>640</width>
<width>450</width>
<height>0</height>
</size>
</property>
Expand Down Expand Up @@ -553,7 +553,7 @@
</property>
<property name="minimumSize">
<size>
<width>640</width>
<width>760</width>
<height>0</height>
</size>
</property>
Expand Down
3 changes: 2 additions & 1 deletion plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ void ChirpChatDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
3 changes: 2 additions & 1 deletion plugins/channelrx/demoddab/dabdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ void DABDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
3 changes: 2 additions & 1 deletion plugins/channelrx/demodfreedv/freedvdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ void FreeDVDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
3 changes: 2 additions & 1 deletion plugins/channelrx/demodpacket/packetdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ void PacketDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
16 changes: 2 additions & 14 deletions plugins/channelrx/demodpager/pagerdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,19 +418,6 @@ void PagerDemodGUI::filter()

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();

if (rollupContents->hasExpandableWidgets()) {
Expand All @@ -440,7 +427,8 @@ void PagerDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
22 changes: 14 additions & 8 deletions plugins/channelrx/demodpager/pagerdemodgui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -816,10 +816,16 @@
<rect>
<x>20</x>
<y>400</y>
<width>351</width>
<width>714</width>
<height>341</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>714</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Waveforms</string>
</property>
Expand Down Expand Up @@ -1019,10 +1025,9 @@
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>LevelMeterSignalDB</class>
Expand All @@ -1031,9 +1036,10 @@
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GLScope</class>
Expand Down
16 changes: 2 additions & 14 deletions plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,19 +475,6 @@ void RadiosondeDemodGUI::filter()

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();

if (rollupContents->hasExpandableWidgets()) {
Expand All @@ -497,7 +484,8 @@ void RadiosondeDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
22 changes: 14 additions & 8 deletions plugins/channelrx/demodradiosonde/radiosondedemodgui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,16 @@
<rect>
<x>20</x>
<y>400</y>
<width>351</width>
<width>714</width>
<height>341</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>714</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Waveforms</string>
</property>
Expand Down Expand Up @@ -1061,10 +1067,9 @@
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>LevelMeterSignalDB</class>
Expand All @@ -1073,9 +1078,10 @@
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GLScope</class>
Expand Down
12 changes: 4 additions & 8 deletions plugins/channelrx/demodssb/ssbdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,15 @@ void SSBDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)

RollupContents *rollupContents = getRollupContents();

if (rollupContents->hasExpandableWidgets())
{
qDebug("SSBDemodGUI::onWidgetRolled: set vertical policy expanding");
if (rollupContents->hasExpandableWidgets()) {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
}
else
{
qDebug("SSBDemodGUI::onWidgetRolled: set vertical policy fixed");
} else {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
3 changes: 2 additions & 1 deletion plugins/channelrx/demodvormc/vordemodmcgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,8 @@ void VORDemodMCGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
3 changes: 2 additions & 1 deletion plugins/channelrx/filesink/filesinkgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ void FileSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
}

int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
applySettings();
Expand Down
Loading

0 comments on commit ed27981

Please sign in to comment.