1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-03 13:47:50 -04:00

Massive UI revamping (v7): AM, DSD, NFM, SSB, WFM demods: improved resizing and rollup collapse/expand handling. Part of #1209

This commit is contained in:
f4exb 2022-04-24 01:24:22 +02:00
parent f762863a23
commit 417d860635
7 changed files with 37 additions and 17 deletions

View File

@ -76,7 +76,7 @@ bool AMDemodGUI::deserialize(const QByteArray& data)
void AMDemodGUI::resizeEvent(QResizeEvent* size) void AMDemodGUI::resizeEvent(QResizeEvent* size)
{ {
int maxWidth = getRollupContents()->maximumWidth(); int maxWidth = getRollupContents()->maximumWidth();
int minHeight = getRollupContents()->minimumHeight() + getRollupContents()->getAdditionalHeiht() + getAdditionalHeight(); int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
resize(width() < maxWidth ? width() : maxWidth, minHeight); resize(width() < maxWidth ? width() : maxWidth, minHeight);
size->accept(); size->accept();
} }

View File

@ -82,6 +82,14 @@ bool DSDDemodGUI::deserialize(const QByteArray& data)
} }
} }
void DSDDemodGUI::resizeEvent(QResizeEvent* size)
{
int maxWidth = getRollupContents()->maximumWidth();
int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
resize(width() < maxWidth ? width() : maxWidth, minHeight);
size->accept();
}
bool DSDDemodGUI::handleMessage(const Message& message) bool DSDDemodGUI::handleMessage(const Message& message)
{ {
if (DSDDemod::MsgConfigureDSDDemod::match(message)) if (DSDDemod::MsgConfigureDSDDemod::match(message))
@ -336,14 +344,17 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_tickCount(0), m_tickCount(0),
m_dsdStatusTextDialog(0) m_dsdStatusTextDialog(0)
{ {
ui->setupUi(getRollupContents()); setAttribute(Qt::WA_DeleteOnClose, true);
getRollupContents()->arrangeRollups();
m_helpURL = "plugins/channelrx/demoddsd/readme.md"; m_helpURL = "plugins/channelrx/demoddsd/readme.md";
RollupContents *rollupContents = getRollupContents();
ui->setupUi(rollupContents);
setSizePolicy(rollupContents->sizePolicy());
rollupContents->arrangeRollups();
connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
ui->screenTV->setColor(true); ui->screenTV->setColor(true);
ui->screenTV->resizeTVScreen(200,200); ui->screenTV->resizeTVScreen(200,200);
setAttribute(Qt::WA_DeleteOnClose, true);
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));

View File

@ -68,6 +68,9 @@ public slots:
void channelMarkerChangedByCursor(); void channelMarkerChangedByCursor();
void channelMarkerHighlightedByCursor(); void channelMarkerHighlightedByCursor();
protected:
void resizeEvent(QResizeEvent* size);
private: private:
// typedef enum // typedef enum
// { // {

View File

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -19,7 +19,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>650</width> <width>650</width>
<height>0</height> <height>392</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>750</width>
<height>392</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
@ -1238,9 +1244,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>LevelMeterSignalDB</class> <class>LevelMeterSignalDB</class>
@ -1249,10 +1256,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>TVScreen</class> <class>TVScreen</class>

View File

@ -58,7 +58,7 @@ bool NFMDemodGUI::deserialize(const QByteArray& data)
void NFMDemodGUI::resizeEvent(QResizeEvent* size) void NFMDemodGUI::resizeEvent(QResizeEvent* size)
{ {
int maxWidth = getRollupContents()->maximumWidth(); int maxWidth = getRollupContents()->maximumWidth();
int minHeight = getRollupContents()->minimumHeight() + getRollupContents()->getAdditionalHeiht() + getAdditionalHeight(); int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
resize(width() < maxWidth ? width() : maxWidth, minHeight); resize(width() < maxWidth ? width() : maxWidth, minHeight);
size->accept(); size->accept();
} }

View File

@ -301,7 +301,7 @@ void SSBDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed); setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
} }
int h = rollupContents->height() + rollupContents->getAdditionalHeiht() + getAdditionalHeight(); int h = rollupContents->height() + getAdditionalHeight();
resize(width(), h); resize(width(), h);
rollupContents->saveState(m_rollupState); rollupContents->saveState(m_rollupState);

View File

@ -58,7 +58,7 @@ bool WFMDemodGUI::deserialize(const QByteArray& data)
void WFMDemodGUI::resizeEvent(QResizeEvent* size) void WFMDemodGUI::resizeEvent(QResizeEvent* size)
{ {
int maxWidth = getRollupContents()->maximumWidth(); int maxWidth = getRollupContents()->maximumWidth();
int minHeight = getRollupContents()->minimumHeight() + getRollupContents()->getAdditionalHeiht() + getAdditionalHeight(); int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
resize(width() < maxWidth ? width() : maxWidth, minHeight); resize(width() < maxWidth ? width() : maxWidth, minHeight);
size->accept(); size->accept();
} }