1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-13 11:18:48 -04:00

Massive UI revamping (v7): Fixed sizing of channel windows. Part of #1209

This commit is contained in:
f4exb
2022-04-24 12:28:56 +02:00
parent e285be84ff
commit 360b8a9753
77 changed files with 1146 additions and 440 deletions
+19 -6
View File
@@ -120,12 +120,14 @@ UDPSourceGUI::UDPSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
m_rfBandwidthChanged(false),
m_doApplySettings(true)
{
ui->setupUi(getRollupContents());
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channeltx/udpsource/readme.md";
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
setAttribute(Qt::WA_DeleteOnClose, true);
m_helpURL = "plugins/channeltx/udpsource/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_udpSource = (UDPSource*) channelTx;
m_spectrumVis = m_udpSource->getSpectrumVis();
@@ -480,7 +482,18 @@ void UDPSourceGUI::onWidgetRolled(QWidget* widget, bool rollDown)
m_udpSource->setSpectrum(rollDown);
}
getRollupContents()->saveState(m_rollupState);
RollupContents *rollupContents = getRollupContents();
if (rollupContents->hasExpandableWidgets()) {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
} else {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}
int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h);
rollupContents->saveState(m_rollupState);
applySettings();
}