Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximize windows part 2 #1510

Merged
merged 2 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
///////////////////////////////////////////////////////////////////////////////////

#include <QLocale>
#include <QResizeEvent>

#include "device/deviceuiset.h"
#include "gui/basicchannelsettingsdialog.h"
Expand Down Expand Up @@ -62,14 +61,6 @@ bool BeamSteeringCWModGUI::deserialize(const QByteArray& data)
}
}

void BeamSteeringCWModGUI::resizeEvent(QResizeEvent* size)
{
int maxWidth = getRollupContents()->maximumWidth();
int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
resize(width() < maxWidth ? width() : maxWidth, minHeight);
size->accept();
}

bool BeamSteeringCWModGUI::handleMessage(const Message& message)
{
if (BeamSteeringCWMod::MsgBasebandNotification::match(message))
Expand Down
3 changes: 0 additions & 3 deletions plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ class BeamSteeringCWModGUI : public ChannelGUI {
void applyInterpolation();
void applyPosition();

protected:
void resizeEvent(QResizeEvent* size);

private slots:
void handleSourceMessages();
void on_channelOutput_currentIndexChanged(int index);
Expand Down
13 changes: 1 addition & 12 deletions plugins/channelmimo/doa2/doa2gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,18 +283,7 @@ void DOA2GUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

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);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
13 changes: 1 addition & 12 deletions plugins/channelmimo/interferometer/interferometergui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,7 @@ void InterferometerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

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);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
14 changes: 1 addition & 13 deletions plugins/channelrx/chanalyzer/chanalyzergui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,19 +458,7 @@ void ChannelAnalyzerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

RollupContents *rollupContents = getRollupContents();

if (rollupContents->hasExpandableWidgets()) {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
} else {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}

int h = rollupContents->height() + getAdditionalHeight();
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
13 changes: 1 addition & 12 deletions plugins/channelrx/demodadsb/adsbdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3783,18 +3783,7 @@ void ADSBDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

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);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
14 changes: 1 addition & 13 deletions plugins/channelrx/demodais/aisdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,7 @@ void AISDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

RollupContents *rollupContents = getRollupContents();

if (rollupContents->hasExpandableWidgets()) {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
} else {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}

int h = rollupContents->height() + getAdditionalHeight();
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
9 changes: 0 additions & 9 deletions plugins/channelrx/demodam/amdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <QDockWidget>
#include <QMainWindow>
#include <QDebug>
#include <QResizeEvent>

#include "amdemodgui.h"
#include "amdemodssbdialog.h"
Expand Down Expand Up @@ -73,14 +72,6 @@ bool AMDemodGUI::deserialize(const QByteArray& data)
}
}

void AMDemodGUI::resizeEvent(QResizeEvent* size)
{
int maxWidth = getRollupContents()->maximumWidth();
int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
resize(width() < maxWidth ? width() : maxWidth, minHeight);
size->accept();
}

bool AMDemodGUI::handleMessage(const Message& message)
{
if (AMDemod::MsgConfigureAMDemod::match(message))
Expand Down
3 changes: 0 additions & 3 deletions plugins/channelrx/demodam/amdemodgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ public slots:
void channelMarkerChangedByCursor();
void channelMarkerHighlightedByCursor();

protected:
void resizeEvent(QResizeEvent* size);

private:
Ui::AMDemodGUI* ui;
PluginAPI* m_pluginAPI;
Expand Down
14 changes: 1 addition & 13 deletions plugins/channelrx/demodapt/aptdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,19 +547,7 @@ void APTDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

RollupContents *rollupContents = getRollupContents();

if (rollupContents->hasExpandableWidgets()) {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
} else {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}

int h = rollupContents->height() + getAdditionalHeight();
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
9 changes: 0 additions & 9 deletions plugins/channelrx/demodatv/atvdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <QDockWidget>
#include <QMainWindow>
#include <QResizeEvent>

#include "atvdemodgui.h"

Expand Down Expand Up @@ -77,14 +76,6 @@ bool ATVDemodGUI::deserialize(const QByteArray& data)
}
}

void ATVDemodGUI::resizeEvent(QResizeEvent* size)
{
int maxWidth = getRollupContents()->maximumWidth();
int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
resize(width() < maxWidth ? width() : maxWidth, minHeight);
size->accept();
}

void ATVDemodGUI::displaySettings()
{
m_channelMarker.blockSignals(true);
Expand Down
3 changes: 0 additions & 3 deletions plugins/channelrx/demodatv/atvdemodgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ public slots:
void channelMarkerChangedByCursor();
void channelMarkerHighlightedByCursor();

protected:
void resizeEvent(QResizeEvent* size);

private:
Ui::ATVDemodGUI* ui;
PluginAPI* m_pluginAPI;
Expand Down
14 changes: 1 addition & 13 deletions plugins/channelrx/demodbfm/bfmdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,7 @@ void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

RollupContents *rollupContents = getRollupContents();

if (rollupContents->hasExpandableWidgets()) {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
} else {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}

int h = rollupContents->height() + getAdditionalHeight();
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
14 changes: 1 addition & 13 deletions plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,19 +329,7 @@ void ChirpChatDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

RollupContents *rollupContents = getRollupContents();

if (rollupContents->hasExpandableWidgets()) {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
} else {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}

int h = rollupContents->height() + getAdditionalHeight();
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
14 changes: 1 addition & 13 deletions plugins/channelrx/demoddab/dabdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,19 +392,7 @@ void DABDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

RollupContents *rollupContents = getRollupContents();

if (rollupContents->hasExpandableWidgets()) {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
} else {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}

int h = rollupContents->height() + getAdditionalHeight();
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
9 changes: 0 additions & 9 deletions plugins/channelrx/demoddatv/datvdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <QDockWidget>
#include <QMainWindow>
#include <QMediaMetaData>
#include <QResizeEvent>

#include "device/deviceuiset.h"
#include "dsp/dspengine.h"
Expand Down Expand Up @@ -93,14 +92,6 @@ bool DATVDemodGUI::deserialize(const QByteArray& arrData)
}
}

void DATVDemodGUI::resizeEvent(QResizeEvent* size)
{
int maxWidth = getRollupContents()->maximumWidth();
int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
resize(width() < maxWidth ? width() : maxWidth, minHeight);
size->accept();
}

bool DATVDemodGUI::handleMessage(const Message& message)
{
if (DATVDemodReport::MsgReportModcodCstlnChange::match(message))
Expand Down
3 changes: 0 additions & 3 deletions plugins/channelrx/demoddatv/datvdemodgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ class DATVDemodGUI : public ChannelGUI

static const char* const m_strChannelID;

protected:
void resizeEvent(QResizeEvent* size);

private slots:
void channelMarkerChangedByCursor();
void channelMarkerHighlightedByCursor();
Expand Down
6 changes: 3 additions & 3 deletions plugins/channelrx/demoddatv/datvdemodgui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<width>556</width>
<height>476</height>
</rect>
</property>
Expand All @@ -18,13 +18,13 @@
</property>
<property name="minimumSize">
<size>
<width>540</width>
<width>556</width>
<height>442</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>540</width>
<width>556</width>
<height>476</height>
</size>
</property>
Expand Down
8 changes: 0 additions & 8 deletions plugins/channelrx/demoddsd/dsddemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ 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)
{
if (DSDDemod::MsgConfigureDSDDemod::match(message))
Expand Down
3 changes: 0 additions & 3 deletions plugins/channelrx/demoddsd/dsddemodgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ public slots:
void channelMarkerChangedByCursor();
void channelMarkerHighlightedByCursor();

protected:
void resizeEvent(QResizeEvent* size);

private:
// typedef enum
// {
Expand Down
14 changes: 1 addition & 13 deletions plugins/channelrx/demodfreedv/freedvdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,7 @@ void FreeDVDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) widget;
(void) rollDown;

RollupContents *rollupContents = getRollupContents();

if (rollupContents->hasExpandableWidgets()) {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
} else {
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}

int h = rollupContents->height() + getAdditionalHeight();
int w = std::max(width(), rollupContents->minimumWidth() + gripSize() * 2);
resize(w, h);

rollupContents->saveState(m_rollupState);
getRollupContents()->saveState(m_rollupState);
applySettings();
}

Expand Down
Loading