1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

Massive UI revamping (v7): better handling of expandable rollup sub widgets. Apply to SSB demod. Part of #1209

This commit is contained in:
f4exb 2022-04-23 13:59:43 +02:00
parent 5ba8b21dcc
commit 72ae871c4a

View File

@ -288,7 +288,23 @@ void SSBDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;
getRollupContents()->saveState(m_rollupState);
RollupContents *rollupContents = getRollupContents();
if (rollupContents->hasExpandableWidgets())
{
qDebug("SSBDemodGUI::onWidgetRolled: set vertical policy expanding");
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
}
else
{
qDebug("SSBDemodGUI::onWidgetRolled: set vertical policy fixed");
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}
int h = rollupContents->height() + rollupContents->getAdditionalHeiht() + getAdditionalHeight();
resize(width(), h);
rollupContents->saveState(m_rollupState);
applySettings();
}
@ -308,11 +324,13 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_squelchOpen(false),
m_audioSampleRate(-1)
{
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demodssb/readme.md";
setAttribute(Qt::WA_DeleteOnClose, true);
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
m_helpURL = "plugins/channelrx/demodssb/readme.md";
RollupContents *rollupContents = getRollupContents();
ui->setupUi(rollupContents);
setSizePolicy(rollupContents->sizePolicy());
rollupContents->arrangeRollups();
connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_ssbDemod = (SSBDemod*) rxChannel;