mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-04 14:17:50 -04:00
Massive UI revamping (v7): make AM, NFM and WFM demods horizontally resizable within limits. Part of #1209
This commit is contained in:
parent
72ae871c4a
commit
c803788dbb
@ -18,6 +18,7 @@
|
|||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QResizeEvent>
|
||||||
|
|
||||||
#include "amdemodgui.h"
|
#include "amdemodgui.h"
|
||||||
#include "amdemodssbdialog.h"
|
#include "amdemodssbdialog.h"
|
||||||
@ -72,6 +73,14 @@ bool AMDemodGUI::deserialize(const QByteArray& data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AMDemodGUI::resizeEvent(QResizeEvent* size)
|
||||||
|
{
|
||||||
|
int maxWidth = getRollupContents()->maximumWidth();
|
||||||
|
int minHeight = getRollupContents()->minimumHeight() + getRollupContents()->getAdditionalHeiht() + getAdditionalHeight();
|
||||||
|
resize(width() < maxWidth ? width() : maxWidth, minHeight);
|
||||||
|
size->accept();
|
||||||
|
}
|
||||||
|
|
||||||
bool AMDemodGUI::handleMessage(const Message& message)
|
bool AMDemodGUI::handleMessage(const Message& message)
|
||||||
{
|
{
|
||||||
if (AMDemod::MsgConfigureAMDemod::match(message))
|
if (AMDemod::MsgConfigureAMDemod::match(message))
|
||||||
@ -259,11 +268,13 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS
|
|||||||
m_samUSB(true),
|
m_samUSB(true),
|
||||||
m_tickCount(0)
|
m_tickCount(0)
|
||||||
{
|
{
|
||||||
ui->setupUi(getRollupContents());
|
|
||||||
getRollupContents()->arrangeRollups();
|
|
||||||
m_helpURL = "plugins/channelrx/demodam/readme.md";
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
m_helpURL = "plugins/channelrx/demodam/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 &)));
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
||||||
|
|
||||||
m_amDemod = reinterpret_cast<AMDemod*>(rxChannel);
|
m_amDemod = reinterpret_cast<AMDemod*>(rxChannel);
|
||||||
|
@ -47,6 +47,9 @@ public slots:
|
|||||||
void channelMarkerChangedByCursor();
|
void channelMarkerChangedByCursor();
|
||||||
void channelMarkerHighlightedByCursor();
|
void channelMarkerHighlightedByCursor();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void resizeEvent(QResizeEvent* size);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AMDemodGUI* ui;
|
Ui::AMDemodGUI* ui;
|
||||||
PluginAPI* m_pluginAPI;
|
PluginAPI* m_pluginAPI;
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>360</width>
|
<width>360</width>
|
||||||
<height>153</height>
|
<height>155</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -22,6 +22,12 @@
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>560</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Liberation Sans</family>
|
<family>Liberation Sans</family>
|
||||||
@ -428,9 +434,10 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<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>RollupContents</class>
|
<class>RollupContents</class>
|
||||||
@ -438,18 +445,17 @@
|
|||||||
<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>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"/>
|
||||||
|
@ -55,6 +55,14 @@ bool NFMDemodGUI::deserialize(const QByteArray& data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NFMDemodGUI::resizeEvent(QResizeEvent* size)
|
||||||
|
{
|
||||||
|
int maxWidth = getRollupContents()->maximumWidth();
|
||||||
|
int minHeight = getRollupContents()->minimumHeight() + getRollupContents()->getAdditionalHeiht() + getAdditionalHeight();
|
||||||
|
resize(width() < maxWidth ? width() : maxWidth, minHeight);
|
||||||
|
size->accept();
|
||||||
|
}
|
||||||
|
|
||||||
bool NFMDemodGUI::handleMessage(const Message& message)
|
bool NFMDemodGUI::handleMessage(const Message& message)
|
||||||
{
|
{
|
||||||
if (NFMDemodReport::MsgReportCTCSSFreq::match(message))
|
if (NFMDemodReport::MsgReportCTCSSFreq::match(message))
|
||||||
@ -359,12 +367,13 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
|
|||||||
m_dcsShowPositive(false),
|
m_dcsShowPositive(false),
|
||||||
m_tickCount(0)
|
m_tickCount(0)
|
||||||
{
|
{
|
||||||
ui->setupUi(getRollupContents());
|
|
||||||
getRollupContents()->arrangeRollups();
|
|
||||||
m_helpURL = "plugins/channelrx/demodnfm/readme.md";
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
|
m_helpURL = "plugins/channelrx/demodnfm/readme.md";
|
||||||
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
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 &)));
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
||||||
|
|
||||||
m_nfmDemod = reinterpret_cast<NFMDemod*>(rxChannel);
|
m_nfmDemod = reinterpret_cast<NFMDemod*>(rxChannel);
|
||||||
|
@ -46,6 +46,9 @@ public slots:
|
|||||||
void channelMarkerChangedByCursor();
|
void channelMarkerChangedByCursor();
|
||||||
void channelMarkerHighlightedByCursor();
|
void channelMarkerHighlightedByCursor();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void resizeEvent(QResizeEvent* size);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::NFMDemodGUI* ui;
|
Ui::NFMDemodGUI* ui;
|
||||||
PluginAPI* m_pluginAPI;
|
PluginAPI* m_pluginAPI;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -22,6 +22,12 @@
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>560</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Liberation Sans</family>
|
<family>Liberation Sans</family>
|
||||||
@ -779,9 +785,10 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<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>RollupContents</class>
|
<class>RollupContents</class>
|
||||||
@ -789,18 +796,17 @@
|
|||||||
<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>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"/>
|
||||||
|
@ -55,6 +55,14 @@ bool WFMDemodGUI::deserialize(const QByteArray& data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WFMDemodGUI::resizeEvent(QResizeEvent* size)
|
||||||
|
{
|
||||||
|
int maxWidth = getRollupContents()->maximumWidth();
|
||||||
|
int minHeight = getRollupContents()->minimumHeight() + getRollupContents()->getAdditionalHeiht() + getAdditionalHeight();
|
||||||
|
resize(width() < maxWidth ? width() : maxWidth, minHeight);
|
||||||
|
size->accept();
|
||||||
|
}
|
||||||
|
|
||||||
bool WFMDemodGUI::handleMessage(const Message& message)
|
bool WFMDemodGUI::handleMessage(const Message& message)
|
||||||
{
|
{
|
||||||
if (WFMDemod::MsgConfigureWFMDemod::match(message))
|
if (WFMDemod::MsgConfigureWFMDemod::match(message))
|
||||||
@ -218,11 +226,13 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
|
|||||||
m_squelchOpen(false),
|
m_squelchOpen(false),
|
||||||
m_audioSampleRate(-1)
|
m_audioSampleRate(-1)
|
||||||
{
|
{
|
||||||
ui->setupUi(getRollupContents());
|
|
||||||
getRollupContents()->arrangeRollups();
|
|
||||||
m_helpURL = "plugins/channelrx/demodwfm/readme.md";
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
|
m_helpURL = "plugins/channelrx/demodwfm/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 &)));
|
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()));
|
||||||
|
|
||||||
|
@ -44,6 +44,9 @@ public slots:
|
|||||||
void channelMarkerChangedByCursor();
|
void channelMarkerChangedByCursor();
|
||||||
void channelMarkerHighlightedByCursor();
|
void channelMarkerHighlightedByCursor();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void resizeEvent(QResizeEvent* size);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::WFMDemodGUI* ui;
|
Ui::WFMDemodGUI* ui;
|
||||||
PluginAPI* m_pluginAPI;
|
PluginAPI* m_pluginAPI;
|
||||||
|
@ -10,16 +10,22 @@
|
|||||||
<height>170</height>
|
<height>170</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>302</width>
|
<width>302</width>
|
||||||
<height>0</height>
|
<height>170</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>302</width>
|
<width>560</width>
|
||||||
<height>16777215</height>
|
<height>170</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@ -46,12 +52,6 @@
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>300</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Settings</string>
|
<string>Settings</string>
|
||||||
</property>
|
</property>
|
||||||
@ -435,6 +435,18 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>ValueDial</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/valuedial.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ValueDialZ</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/valuedialz.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>RollupContents</class>
|
<class>RollupContents</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
@ -447,18 +459,6 @@
|
|||||||
<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>
|
|
||||||
<class>ValueDial</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>gui/valuedial.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../sdrgui/resources/res.qrc"/>
|
<include location="../../../sdrgui/resources/res.qrc"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user