1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-07-13 06:15:22 -04:00

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

This commit is contained in:
f4exb 2022-04-25 00:15:46 +02:00
parent f77e38eb3f
commit 5f9d14a56e
15 changed files with 124 additions and 110 deletions

View File

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>

View File

@ -55,6 +55,11 @@ TestMIGui::TestMIGui(DeviceUISet *deviceUISet, QWidget* parent) :
{ {
qDebug("TestMIGui::TestMIGui"); qDebug("TestMIGui::TestMIGui");
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
m_helpURL = "plugins/samplemimo/testmi/readme.md";
ui->setupUi(getContents());
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
getContents()->setStyleSheet("#TestMIGui { background-color: rgb(64, 64, 64); }");
m_sampleMIMO = m_deviceUISet->m_deviceAPI->getSampleMIMO(); m_sampleMIMO = m_deviceUISet->m_deviceAPI->getSampleMIMO();
m_streamIndex = 0; m_streamIndex = 0;
m_deviceCenterFrequencies.push_back(m_settings.m_streams[0].m_centerFrequency); m_deviceCenterFrequencies.push_back(m_settings.m_streams[0].m_centerFrequency);
@ -62,10 +67,6 @@ TestMIGui::TestMIGui(DeviceUISet *deviceUISet, QWidget* parent) :
m_deviceSampleRates.push_back(m_settings.m_streams[0].m_sampleRate / (1<<m_settings.m_streams[0].m_log2Decim)); m_deviceSampleRates.push_back(m_settings.m_streams[0].m_sampleRate / (1<<m_settings.m_streams[0].m_log2Decim));
m_deviceSampleRates.push_back(m_settings.m_streams[1].m_sampleRate / (1<<m_settings.m_streams[1].m_log2Decim)); m_deviceSampleRates.push_back(m_settings.m_streams[1].m_sampleRate / (1<<m_settings.m_streams[1].m_log2Decim));
ui->setupUi(getContents());
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
getContents()->setStyleSheet("#TestMIGui { background-color: rgb(64, 64, 64); }");
m_helpURL = "plugins/samplemimo/testmi/readme.md";
ui->spectrumSource->addItem("0"); ui->spectrumSource->addItem("0");
ui->spectrumSource->addItem("1"); ui->spectrumSource->addItem("1");
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));

View File

@ -51,10 +51,12 @@ TestMOSyncGui::TestMOSyncGui(DeviceUISet *deviceUISet, QWidget* parent) :
m_lastEngineState(DeviceAPI::StNotStarted) m_lastEngineState(DeviceAPI::StNotStarted)
{ {
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
ui->setupUi(getContents());
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
getContents()->setStyleSheet("#TestMOSyncGui { background-color: rgb(64, 64, 64); }");
m_helpURL = "plugins/samplemimo/testmosync/readme.md"; m_helpURL = "plugins/samplemimo/testmosync/readme.md";
QWidget *contents = getContents();
ui->setupUi(contents);
setSizePolicy(contents->sizePolicy());
getContents()->setStyleSheet("#TestMOSyncGui { background-color: rgb(64, 64, 64); }");
m_sampleMIMO = (TestMOSync*) m_deviceUISet->m_deviceAPI->getSampleMIMO(); m_sampleMIMO = (TestMOSync*) m_deviceUISet->m_deviceAPI->getSampleMIMO();
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));

View File

@ -7,11 +7,11 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>360</width> <width>360</width>
<height>320</height> <height>420</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -19,7 +19,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>360</width> <width>360</width>
<height>0</height> <height>420</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
@ -335,33 +335,41 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="spectrumLayout"> <widget class="QWidget" name="spectrum" native="true">
<item> <property name="sizePolicy">
<widget class="GLSpectrum" name="glSpectrum" native="true"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<property name="sizePolicy"> <horstretch>0</horstretch>
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <verstretch>0</verstretch>
<horstretch>0</horstretch> </sizepolicy>
<verstretch>0</verstretch> </property>
</sizepolicy> <layout class="QVBoxLayout" name="spectrumLayout">
</property> <item>
<property name="minimumSize"> <widget class="GLSpectrum" name="glSpectrum" native="true">
<size> <property name="sizePolicy">
<width>200</width> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<height>200</height> <horstretch>0</horstretch>
</size> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="font"> </property>
<font> <property name="minimumSize">
<family>Liberation Mono</family> <size>
<pointsize>8</pointsize> <width>200</width>
</font> <height>200</height>
</property> </size>
</widget> </property>
</item> <property name="font">
<item> <font>
<widget class="GLSpectrumGUI" name="spectrumGUI" native="true"/> <family>Liberation Mono</family>
</item> <pointsize>8</pointsize>
</layout> </font>
</property>
</widget>
</item>
<item>
<widget class="GLSpectrumGUI" name="spectrumGUI" native="true"/>
</item>
</layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@ -7,11 +7,11 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>360</width> <width>360</width>
<height>106</height> <height>124</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -19,13 +19,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>360</width> <width>360</width>
<height>106</height> <height>124</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>360</width> <width>360</width>
<height>106</height> <height>143</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">

View File

@ -7,11 +7,11 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>360</width> <width>360</width>
<height>106</height> <height>126</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -19,13 +19,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>360</width> <width>360</width>
<height>106</height> <height>126</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>360</width> <width>360</width>
<height>106</height> <height>144</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>360</width> <width>360</width>
<height>151</height> <height>174</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -19,13 +19,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>360</width> <width>360</width>
<height>151</height> <height>174</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>360</width> <width>360</width>
<height>151</height> <height>207</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
@ -39,7 +39,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing"> <property name="spacing">
<number>3</number> <number>2</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>2</number> <number>2</number>

View File

@ -50,11 +50,12 @@ TestSinkGui::TestSinkGui(DeviceUISet *deviceUISet, QWidget* parent) :
m_lastEngineState(DeviceAPI::StNotStarted) m_lastEngineState(DeviceAPI::StNotStarted)
{ {
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
ui->setupUi(getContents()); m_helpURL = "plugins/samplesink/testsink/readme.md";
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); QWidget *contents = getContents();
ui->setupUi(contents);
setSizePolicy(contents->sizePolicy());
setMinimumSize(m_MinimumWidth, m_MinimumHeight); setMinimumSize(m_MinimumWidth, m_MinimumHeight);
getContents()->setStyleSheet("#TestSinkGui { background-color: rgb(64, 64, 64); }"); getContents()->setStyleSheet("#TestSinkGui { background-color: rgb(64, 64, 64); }");
m_helpURL = "plugins/samplesink/testsink/readme.md";
m_sampleSink = (TestSinkOutput*) m_deviceUISet->m_deviceAPI->getSampleSink(); m_sampleSink = (TestSinkOutput*) m_deviceUISet->m_deviceAPI->getSampleSink();
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));

View File

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -290,46 +290,54 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="spectrumLayout"> <widget class="QWidget" name="spec" native="true">
<item> <property name="sizePolicy">
<widget class="GLSpectrum" name="glSpectrum" native="true"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<property name="sizePolicy"> <horstretch>0</horstretch>
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <verstretch>0</verstretch>
<horstretch>0</horstretch> </sizepolicy>
<verstretch>0</verstretch> </property>
</sizepolicy> <layout class="QVBoxLayout" name="spectrumLayout">
</property> <item>
<property name="minimumSize"> <widget class="GLSpectrum" name="glSpectrum" native="true">
<size> <property name="sizePolicy">
<width>354</width> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<height>200</height> <horstretch>0</horstretch>
</size> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="font"> </property>
<font> <property name="minimumSize">
<family>Liberation Mono</family> <size>
<pointsize>8</pointsize> <width>354</width>
</font> <height>200</height>
</property> </size>
</widget> </property>
</item> <property name="font">
<item> <font>
<widget class="GLSpectrumGUI" name="spectrumGUI" native="true"> <family>Liberation Mono</family>
<property name="sizePolicy"> <pointsize>8</pointsize>
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> </font>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> </widget>
</sizepolicy> </item>
</property> <item>
<property name="minimumSize"> <widget class="GLSpectrumGUI" name="spectrumGUI" native="true">
<size> <property name="sizePolicy">
<width>354</width> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<height>30</height> <horstretch>0</horstretch>
</size> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
</item> <property name="minimumSize">
</layout> <size>
<width>354</width>
<height>30</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@ -62,10 +62,11 @@ SigMFFileInputGUI::SigMFFileInputGUI(DeviceUISet *deviceUISet, QWidget* parent)
m_lastEngineState(DeviceAPI::StNotStarted) m_lastEngineState(DeviceAPI::StNotStarted)
{ {
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
ui->setupUi(getContents());
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
getContents()->setStyleSheet("#SigMFFileInputGUI { background-color: rgb(64, 64, 64); }");
m_helpURL = "plugins/samplesource/sigmffileinput/readme.md"; m_helpURL = "plugins/samplesource/sigmffileinput/readme.md";
QWidget *contents = getContents();
ui->setupUi(contents);
setSizePolicy(contents->sizePolicy());
contents->setStyleSheet("#SigMFFileInputGUI { background-color: rgb(64, 64, 64); }");
ui->fileNameText->setText(m_metaFileName); ui->fileNameText->setText(m_metaFileName);
ui->crcLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); ui->crcLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
@ -130,12 +131,6 @@ bool SigMFFileInputGUI::deserialize(const QByteArray& data)
} }
} }
void SigMFFileInputGUI::resizeEvent(QResizeEvent* size)
{
resize(436, height());
size->accept();
}
void SigMFFileInputGUI::handleInputMessages() void SigMFFileInputGUI::handleInputMessages()
{ {
Message* message; Message* message;

View File

@ -47,9 +47,6 @@ public:
bool deserialize(const QByteArray& data); bool deserialize(const QByteArray& data);
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
protected:
void resizeEvent(QResizeEvent* size);
private: private:
Ui::SigMFFileInputGUI* ui; Ui::SigMFFileInputGUI* ui;

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>436</width> <width>450</width>
<height>436</height> <height>436</height>
</rect> </rect>
</property> </property>
@ -18,13 +18,13 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>436</width> <width>450</width>
<height>436</height> <height>436</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>436</width> <width>450</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>

View File

@ -56,6 +56,7 @@ ChannelGUI::ChannelGUI(QWidget *parent) :
m_indexLabel->setToolTip("Channel index"); m_indexLabel->setToolTip("Channel index");
m_settingsButton = new QPushButton(); m_settingsButton = new QPushButton();
m_settingsButton->setFixedSize(20, 20);
QIcon settingsIcon(":/gear.png"); QIcon settingsIcon(":/gear.png");
m_settingsButton->setIcon(settingsIcon); m_settingsButton->setIcon(settingsIcon);
m_settingsButton->setToolTip("Common settings"); m_settingsButton->setToolTip("Common settings");

View File

@ -163,7 +163,7 @@ DeviceGUI::DeviceGUI(QWidget *parent) :
m_bottomLayout->addWidget(m_statusLabel); m_bottomLayout->addWidget(m_statusLabel);
m_sizeGripBottomRight = new QSizeGrip(this); m_sizeGripBottomRight = new QSizeGrip(this);
m_sizeGripBottomRight->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); m_sizeGripBottomRight->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
m_sizeGripBottomRight->setFixedHeight(20);
// m_bottomLayout->addStretch(1); // m_bottomLayout->addStretch(1);
m_bottomLayout->addWidget(m_sizeGripBottomRight, 0, Qt::AlignBottom | Qt::AlignRight); m_bottomLayout->addWidget(m_sizeGripBottomRight, 0, Qt::AlignBottom | Qt::AlignRight);

View File

@ -51,6 +51,7 @@ FeatureGUI::FeatureGUI(QWidget *parent) :
m_indexLabel->setToolTip("Feature index"); m_indexLabel->setToolTip("Feature index");
m_settingsButton = new QPushButton(); m_settingsButton = new QPushButton();
m_settingsButton->setFixedSize(20, 20);
QIcon settingsIcon(":/gear.png"); QIcon settingsIcon(":/gear.png");
m_settingsButton->setIcon(settingsIcon); m_settingsButton->setIcon(settingsIcon);
m_settingsButton->setToolTip("Common settings"); m_settingsButton->setToolTip("Common settings");