diff --git a/plugins/feature/afc/afcgui.cpp b/plugins/feature/afc/afcgui.cpp index 791b35c02..413ebc6c4 100644 --- a/plugins/feature/afc/afcgui.cpp +++ b/plugins/feature/afc/afcgui.cpp @@ -68,7 +68,9 @@ bool AFCGUI::deserialize(const QByteArray& data) void AFCGUI::resizeEvent(QResizeEvent* size) { - adjustSize(); + int maxWidth = getRollupContents()->maximumWidth(); + int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); + resize(width() < maxWidth ? width() : maxWidth, minHeight); size->accept(); } @@ -137,11 +139,13 @@ AFCGUI::AFCGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur m_doApplySettings(true), m_lastFeatureState(0) { - ui->setupUi(getRollupContents()); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/afc/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); + m_helpURL = "plugins/feature/afc/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->targetFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->targetFrequency->setValueRange(10, 0, 9999999999L); @@ -149,7 +153,6 @@ AFCGUI::AFCGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur ui->toleranceFrequency->setColorMapper(ColorMapper(ColorMapper::GrayYellow)); ui->toleranceFrequency->setValueRange(5, 0, 99999L); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); m_afc = reinterpret_cast(feature); m_afc->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/afc/afcgui.ui b/plugins/feature/afc/afcgui.ui index de65c6172..b72795a21 100644 --- a/plugins/feature/afc/afcgui.ui +++ b/plugins/feature/afc/afcgui.ui @@ -11,7 +11,7 @@ - + 0 0 @@ -24,7 +24,7 @@ - 320 + 560 100 @@ -412,6 +412,12 @@ + + RollupContents + QWidget +
gui/rollupcontents.h
+ 1 +
ButtonSwitch QToolButton @@ -423,12 +429,6 @@
gui/valuedial.h
1
- - RollupContents - QWidget -
gui/rollupcontents.h
- 1 -
diff --git a/plugins/feature/ais/aisgui.cpp b/plugins/feature/ais/aisgui.cpp index 4ea066702..b021ccacb 100644 --- a/plugins/feature/ais/aisgui.cpp +++ b/plugins/feature/ais/aisgui.cpp @@ -166,7 +166,18 @@ void AISGUI::onWidgetRolled(QWidget* widget, bool rollDown) (void) widget; (void) 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(); } @@ -178,11 +189,14 @@ AISGUI::AISGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur m_doApplySettings(true), m_lastFeatureState(0) { - ui->setupUi(getRollupContents()); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/ais/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/ais/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_ais = reinterpret_cast(feature); m_ais->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/antennatools/antennatoolsgui.cpp b/plugins/feature/antennatools/antennatoolsgui.cpp index 4fcd57780..ff316198c 100644 --- a/plugins/feature/antennatools/antennatoolsgui.cpp +++ b/plugins/feature/antennatools/antennatoolsgui.cpp @@ -110,7 +110,18 @@ void AntennaToolsGUI::onWidgetRolled(QWidget* widget, bool rollDown) (void) widget; (void) 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(); } @@ -122,13 +133,14 @@ AntennaToolsGUI::AntennaToolsGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe m_doApplySettings(true), m_deviceSets(0) { - ui->setupUi(getRollupContents()); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/antennatools/readme.md"; - setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/antennatools/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_antennatools = reinterpret_cast(feature); m_antennatools->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/aprs/aprsgui.cpp b/plugins/feature/aprs/aprsgui.cpp index 80ed4108c..416de7d4b 100644 --- a/plugins/feature/aprs/aprsgui.cpp +++ b/plugins/feature/aprs/aprsgui.cpp @@ -430,12 +430,14 @@ APRSGUI::APRSGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feat m_doApplySettings(true), m_lastFeatureState(0) { - ui->setupUi(getRollupContents()); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/aprs/readme.md"; - setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/aprs/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_aprs = reinterpret_cast(feature); m_aprs->setMessageQueueToGUI(&m_inputMessageQueue); @@ -666,7 +668,10 @@ void APRSGUI::resizeEvent(QResizeEvent* size) plotWeather(); plotTelemetry(); plotMotion(); - FeatureGUI::resizeEvent(size); + int maxWidth = getRollupContents()->maximumWidth(); + int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); + resize(width() < maxWidth ? width() : maxWidth, minHeight); + size->accept(); } void APRSGUI::onMenuDialogCalled(const QPoint &p) diff --git a/plugins/feature/aprs/aprsgui.ui b/plugins/feature/aprs/aprsgui.ui index 8194bb504..1a6fa0712 100644 --- a/plugins/feature/aprs/aprsgui.ui +++ b/plugins/feature/aprs/aprsgui.ui @@ -7,11 +7,11 @@ 0 0 469 - 761 + 578 - + 0 0 @@ -22,6 +22,12 @@ 0 + + + 700 + 16777215 + + Liberation Sans @@ -148,7 +154,7 @@ - + 0 0 @@ -1447,17 +1453,17 @@ - - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
RollupContents QWidget
gui/rollupcontents.h
1
+ + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
QChartView QGraphicsView diff --git a/plugins/feature/demodanalyzer/demodanalyzergui.cpp b/plugins/feature/demodanalyzer/demodanalyzergui.cpp index 9872a0bfb..006176c59 100644 --- a/plugins/feature/demodanalyzer/demodanalyzergui.cpp +++ b/plugins/feature/demodanalyzer/demodanalyzergui.cpp @@ -125,7 +125,18 @@ void DemodAnalyzerGUI::onWidgetRolled(QWidget* widget, bool rollDown) (void) widget; (void) 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(); } @@ -139,11 +150,13 @@ DemodAnalyzerGUI::DemodAnalyzerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUI m_lastFeatureState(0), m_selectedChannel(nullptr) { - ui->setupUi(getRollupContents()); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/demodanalyzer/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/demodanalyzer/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); m_demodAnalyzer = reinterpret_cast(feature); m_demodAnalyzer->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/gs232controller/gs232controllergui.cpp b/plugins/feature/gs232controller/gs232controllergui.cpp index f629f0ff7..695083ee2 100644 --- a/plugins/feature/gs232controller/gs232controllergui.cpp +++ b/plugins/feature/gs232controller/gs232controllergui.cpp @@ -73,7 +73,9 @@ bool GS232ControllerGUI::deserialize(const QByteArray& data) void GS232ControllerGUI::resizeEvent(QResizeEvent* size) { - adjustSize(); + int maxWidth = getRollupContents()->maximumWidth(); + int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); + resize(width() < maxWidth ? width() : maxWidth, minHeight); size->accept(); } @@ -147,12 +149,14 @@ GS232ControllerGUI::GS232ControllerGUI(PluginAPI* pluginAPI, FeatureUISet *featu m_lastFeatureState(0), m_lastOnTarget(false) { - ui->setupUi(getRollupContents()); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/gs232controller/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/gs232controller/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_gs232Controller = reinterpret_cast(feature); m_gs232Controller->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/gs232controller/gs232controllergui.ui b/plugins/feature/gs232controller/gs232controllergui.ui index e159e79ea..b697bc9eb 100644 --- a/plugins/feature/gs232controller/gs232controllergui.ui +++ b/plugins/feature/gs232controller/gs232controllergui.ui @@ -11,7 +11,7 @@
- + 0 0 @@ -24,7 +24,7 @@ - 360 + 560 16777215 @@ -541,17 +541,17 @@ - - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
RollupContents QWidget
gui/rollupcontents.h
1
+ + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
startStop diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp b/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp index dd8b2822a..1ff5381c6 100644 --- a/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp +++ b/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp @@ -69,7 +69,9 @@ bool JogdialControllerGUI::deserialize(const QByteArray& data) void JogdialControllerGUI::resizeEvent(QResizeEvent* size) { - adjustSize(); + int maxWidth = getRollupContents()->maximumWidth(); + int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); + resize(width() < maxWidth ? width() : maxWidth, minHeight); size->accept(); } @@ -152,12 +154,13 @@ JogdialControllerGUI::JogdialControllerGUI(PluginAPI* pluginAPI, FeatureUISet *f m_lastFeatureState(0), m_selectedChannel(nullptr) { - ui->setupUi(getRollupContents()); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/jogdialcontroller/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/jogdialcontroller/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); m_jogdialController = reinterpret_cast(feature); m_jogdialController->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollergui.ui b/plugins/feature/jogdialcontroller/jogdialcontrollergui.ui index 26ed65d0f..01211f584 100644 --- a/plugins/feature/jogdialcontroller/jogdialcontrollergui.ui +++ b/plugins/feature/jogdialcontroller/jogdialcontrollergui.ui @@ -6,26 +6,26 @@ 0 0 - 340 - 50 + 370 + 60 - + 0 0 - 340 - 50 + 360 + 60 - 340 - 50 + 370 + 16777215 @@ -46,6 +46,12 @@ 51 + + + 0 + 0 + + 360 diff --git a/plugins/feature/map/mapgui.cpp b/plugins/feature/map/mapgui.cpp index fb199fc80..33aa3073b 100644 --- a/plugins/feature/map/mapgui.cpp +++ b/plugins/feature/map/mapgui.cpp @@ -162,7 +162,18 @@ void MapGUI::onWidgetRolled(QWidget* widget, bool rollDown) (void) widget; (void) 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(); } @@ -179,9 +190,13 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur m_radioTimeDialog(this), m_cesium(nullptr) { - ui->setupUi(getRollupContents()); - getRollupContents()->arrangeRollups(); + setAttribute(Qt::WA_DeleteOnClose, true); m_helpURL = "plugins/feature/map/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); m_osmPort = 0; m_templateServer = new OSMTemplateServer(thunderforestAPIKey(), maptilerAPIKey(), m_osmPort); @@ -201,8 +216,6 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur m_settings.m_modelURL = QString("http://127.0.0.1:%1/3d/").arg(m_webPort); m_webServer->addPathSubstitution("3d", m_settings.m_modelDir); - setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); m_map = reinterpret_cast(feature); m_map->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/pertester/pertestergui.cpp b/plugins/feature/pertester/pertestergui.cpp index 45d1bdb4b..5458e46bd 100644 --- a/plugins/feature/pertester/pertestergui.cpp +++ b/plugins/feature/pertester/pertestergui.cpp @@ -71,7 +71,9 @@ bool PERTesterGUI::deserialize(const QByteArray& data) void PERTesterGUI::resizeEvent(QResizeEvent* size) { - adjustSize(); + int maxWidth = getRollupContents()->maximumWidth(); + int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); + resize(width() < maxWidth ? width() : maxWidth, minHeight); size->accept(); } @@ -133,12 +135,14 @@ PERTesterGUI::PERTesterGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Fea m_doApplySettings(true), m_lastFeatureState(0) { - ui->setupUi(getRollupContents()); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/pertester/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/pertester/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_perTester = reinterpret_cast(feature); m_perTester->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/pertester/pertestergui.ui b/plugins/feature/pertester/pertestergui.ui index aa295bd45..f2917bf2b 100644 --- a/plugins/feature/pertester/pertestergui.ui +++ b/plugins/feature/pertester/pertestergui.ui @@ -6,26 +6,26 @@ 0 0 - 335 - 472 + 360 + 477 - + 0 0 - 335 - 472 + 360 + 0 - 335 - 472 + 600 + 16777215 @@ -42,10 +42,16 @@ 2 2 - 331 + 351 341 + + + 0 + 0 + + Settings @@ -464,7 +470,7 @@ Substitutions: 2 352 - 331 + 351 117 diff --git a/plugins/feature/radiosonde/radiosondegui.cpp b/plugins/feature/radiosonde/radiosondegui.cpp index da49edcec..8a60dedd2 100644 --- a/plugins/feature/radiosonde/radiosondegui.cpp +++ b/plugins/feature/radiosonde/radiosondegui.cpp @@ -117,7 +117,18 @@ void RadiosondeGUI::onWidgetRolled(QWidget* widget, bool rollDown) (void) widget; (void) 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(); } @@ -129,11 +140,14 @@ RadiosondeGUI::RadiosondeGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, F m_doApplySettings(true), m_lastFeatureState(0) { - ui->setupUi(getRollupContents()); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/radiosonde/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/radiosonde/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_radiosonde = reinterpret_cast(feature); m_radiosonde->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/radiosonde/radiosondegui.ui b/plugins/feature/radiosonde/radiosondegui.ui index 810a16bfa..4dccbfa46 100644 --- a/plugins/feature/radiosonde/radiosondegui.ui +++ b/plugins/feature/radiosonde/radiosondegui.ui @@ -22,12 +22,6 @@ 100 - - - 16777215 - 16777215 - - 9 diff --git a/plugins/feature/rigctlserver/rigctlservergui.cpp b/plugins/feature/rigctlserver/rigctlservergui.cpp index f40c7a23e..a9f5eef5e 100644 --- a/plugins/feature/rigctlserver/rigctlservergui.cpp +++ b/plugins/feature/rigctlserver/rigctlservergui.cpp @@ -71,7 +71,9 @@ bool RigCtlServerGUI::deserialize(const QByteArray& data) void RigCtlServerGUI::resizeEvent(QResizeEvent* size) { - adjustSize(); + int maxWidth = getRollupContents()->maximumWidth(); + int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); + resize(width() < maxWidth ? width() : maxWidth, minHeight); size->accept(); } @@ -133,12 +135,14 @@ RigCtlServerGUI::RigCtlServerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe m_doApplySettings(true), m_lastFeatureState(0) { - ui->setupUi(getRollupContents()); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/rigctlserver/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/rigctlserver/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_rigCtlServer = reinterpret_cast(feature); m_rigCtlServer->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/rigctlserver/rigctlservergui.ui b/plugins/feature/rigctlserver/rigctlservergui.ui index 1d896fa27..cef98d408 100644 --- a/plugins/feature/rigctlserver/rigctlservergui.ui +++ b/plugins/feature/rigctlserver/rigctlservergui.ui @@ -6,25 +6,25 @@ 0 0 - 304 + 330 173 - + 0 0 - 304 + 330 173 - 304 + 560 173 @@ -42,7 +42,7 @@ 2 2 - 300 + 328 171 diff --git a/plugins/feature/satellitetracker/satellitetrackergui.cpp b/plugins/feature/satellitetracker/satellitetrackergui.cpp index 6dd97e413..7be65d894 100644 --- a/plugins/feature/satellitetracker/satellitetrackergui.cpp +++ b/plugins/feature/satellitetracker/satellitetrackergui.cpp @@ -230,7 +230,18 @@ void SatelliteTrackerGUI::onWidgetRolled(QWidget* widget, bool rollDown) (void) widget; (void) 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(); } @@ -248,11 +259,14 @@ SatelliteTrackerGUI::SatelliteTrackerGUI(PluginAPI* pluginAPI, FeatureUISet *fea m_polarChart(nullptr), m_geostationarySatVisible(false) { - ui->setupUi(getRollupContents()); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/satellitetracker/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/satellitetracker/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_satelliteTracker = reinterpret_cast(feature); m_satelliteTracker->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/satellitetracker/satellitetrackergui.ui b/plugins/feature/satellitetracker/satellitetrackergui.ui index fb84bab4a..53abf8df6 100644 --- a/plugins/feature/satellitetracker/satellitetrackergui.ui +++ b/plugins/feature/satellitetracker/satellitetrackergui.ui @@ -399,7 +399,7 @@ - + 0 0 diff --git a/plugins/feature/simpleptt/simplepttgui.cpp b/plugins/feature/simpleptt/simplepttgui.cpp index c2e3667d8..981662ece 100644 --- a/plugins/feature/simpleptt/simplepttgui.cpp +++ b/plugins/feature/simpleptt/simplepttgui.cpp @@ -72,7 +72,9 @@ bool SimplePTTGUI::deserialize(const QByteArray& data) void SimplePTTGUI::resizeEvent(QResizeEvent* size) { - adjustSize(); + int maxWidth = getRollupContents()->maximumWidth(); + int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); + resize(width() < maxWidth ? width() : maxWidth, minHeight); size->accept(); } @@ -157,12 +159,14 @@ SimplePTTGUI::SimplePTTGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Fea m_doApplySettings(true), m_lastFeatureState(0) { - ui->setupUi(getRollupContents()); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/simpleptt/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/simpleptt/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_simplePTT = reinterpret_cast(feature); m_simplePTT->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/simpleptt/simplepttgui.ui b/plugins/feature/simpleptt/simplepttgui.ui index 51e2fccd6..e3d49567e 100644 --- a/plugins/feature/simpleptt/simplepttgui.ui +++ b/plugins/feature/simpleptt/simplepttgui.ui @@ -6,25 +6,25 @@ 0 0 - 304 + 320 155 - + 0 0 - 304 + 320 155 - 304 + 360 155 diff --git a/plugins/feature/startracker/startrackergui.cpp b/plugins/feature/startracker/startrackergui.cpp index 8ff5f40fe..2807b1c83 100644 --- a/plugins/feature/startracker/startrackergui.cpp +++ b/plugins/feature/startracker/startrackergui.cpp @@ -224,7 +224,18 @@ void StarTrackerGUI::onWidgetRolled(QWidget* widget, bool rollDown) (void) widget; (void) 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(); } @@ -254,11 +265,14 @@ StarTrackerGUI::StarTrackerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, m_moonRA(0.0), m_moonDec(0.0) { - ui->setupUi(getRollupContents()); - getRollupContents()->arrangeRollups(); - m_helpURL = "plugins/feature/startracker/readme.md"; setAttribute(Qt::WA_DeleteOnClose, true); - connect(getRollupContents(), SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_helpURL = "plugins/feature/startracker/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + m_starTracker = reinterpret_cast(feature); m_starTracker->setMessageQueueToGUI(&m_inputMessageQueue); diff --git a/plugins/feature/vorlocalizer/vorlocalizergui.cpp b/plugins/feature/vorlocalizer/vorlocalizergui.cpp index dd5c5b0f2..2e4c0b965 100644 --- a/plugins/feature/vorlocalizer/vorlocalizergui.cpp +++ b/plugins/feature/vorlocalizer/vorlocalizergui.cpp @@ -1174,7 +1174,18 @@ void VORLocalizerGUI::onWidgetRolled(QWidget* widget, bool rollDown) (void) widget; (void) 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(); } @@ -1224,9 +1235,13 @@ VORLocalizerGUI::VORLocalizerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe m_lastFeatureState(0), m_rrSecondsCount(0) { - ui->setupUi(getRollupContents()); - getRollupContents()->arrangeRollups(); + setAttribute(Qt::WA_DeleteOnClose, true); m_helpURL = "plugins/feature/vorlocalizer/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->map->rootContext()->setContextProperty("vorModel", &m_vorModel); ui->map->setSource(QUrl(QStringLiteral("qrc:/demodvor/map/map.qml"))); @@ -1234,8 +1249,6 @@ VORLocalizerGUI::VORLocalizerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe m_muteIcon.addPixmap(QPixmap("://sound_off.png"), QIcon::Normal, QIcon::On); m_muteIcon.addPixmap(QPixmap("://sound_on.png"), QIcon::Normal, QIcon::Off); - 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(&m_dlm, &HttpDownloadManager::downloadComplete, this, &VORLocalizerGUI::downloadFinished); diff --git a/plugins/feature/vorlocalizer/vorlocalizergui.ui b/plugins/feature/vorlocalizer/vorlocalizergui.ui index 2824b96e4..4efe999be 100644 --- a/plugins/feature/vorlocalizer/vorlocalizergui.ui +++ b/plugins/feature/vorlocalizer/vorlocalizergui.ui @@ -7,7 +7,7 @@ 0 0 462 - 893 + 850 @@ -348,7 +348,7 @@ QToolTip{background-color: white; color: black;} 0 110 461 - 140 + 145 @@ -357,6 +357,12 @@ QToolTip{background-color: white; color: black;} 0 + + + 0 + 145 + + VORs @@ -477,7 +483,7 @@ QToolTip{background-color: white; color: black;} 0 - 260 + 258 461 581