diff --git a/src/blackgui/components/selcalcodeselector.cpp b/src/blackgui/components/selcalcodeselector.cpp index c493f90bc..863047b33 100644 --- a/src/blackgui/components/selcalcodeselector.cpp +++ b/src/blackgui/components/selcalcodeselector.cpp @@ -100,6 +100,11 @@ namespace BlackGui ui->cb_SelcalPairs2->setCurrentIndex(0); } + int CSelcalCodeSelector::getComboBoxHeight() const + { + return ui->cb_SelcalPairs1->height(); + } + void CSelcalCodeSelector::selcalIndexChanged(int index) { Q_UNUSED(index); diff --git a/src/blackgui/components/selcalcodeselector.h b/src/blackgui/components/selcalcodeselector.h index 273ad238f..4a29be197 100644 --- a/src/blackgui/components/selcalcodeselector.h +++ b/src/blackgui/components/selcalcodeselector.h @@ -59,6 +59,9 @@ namespace BlackGui //! Clear void clear(); + //! The height of the combobox + int getComboBoxHeight() const; + signals: //! Value has been changed void valueChanged(); diff --git a/src/blackgui/components/selcalcodeselector.ui b/src/blackgui/components/selcalcodeselector.ui index d3fe7ba43..6161504c9 100644 --- a/src/blackgui/components/selcalcodeselector.ui +++ b/src/blackgui/components/selcalcodeselector.ui @@ -2,6 +2,14 @@ CSelcalCodeSelector + + + 0 + 0 + 132 + 22 + + SELCAL selector diff --git a/src/blackgui/editors/cockpitcomform.cpp b/src/blackgui/editors/cockpitcomform.cpp index 98d568ea1..d9b8296c4 100644 --- a/src/blackgui/editors/cockpitcomform.cpp +++ b/src/blackgui/editors/cockpitcomform.cpp @@ -31,6 +31,7 @@ namespace BlackGui ui(new Ui::CCockpitComForm) { ui->setupUi(this); + this->alignUiElementsHeight(); // SELCAL pairs in cockpit ui->frp_ComPanelSelcalSelector->clear(); @@ -249,6 +250,7 @@ namespace BlackGui ui->ds_ComPanelCom2Standby->setValue(f); } + this->alignUiElementsHeight(); const CSimulatedAircraft aircraft = this->cockpitValuesToAircraftObject(); emit this->changedCockpitValues(aircraft); } @@ -259,6 +261,24 @@ namespace BlackGui emit this->changedSelcal(selcal); } + void CCockpitComForm::alignUiElementsHeight() + { + const int selcalH = ui->frp_ComPanelSelcalSelector->getComboBoxHeight(); + if (selcalH > ui->ds_ComPanelCom1Standby->height()) + { + ui->ds_ComPanelCom1Standby->setMinimumHeight(selcalH); + ui->ds_ComPanelCom2Standby->setMinimumHeight(selcalH); + } + + const int xpdrH = ui->cbp_ComPanelTransponderMode->height(); + if (xpdrH > ui->ds_ComPanelCom1Active->height()) + { + ui->ds_ComPanelCom1Active->setMinimumHeight(xpdrH); + ui->ds_ComPanelCom2Active->setMinimumHeight(xpdrH); + ui->sbp_ComPanelTransponder->setMinimumHeight(xpdrH); + } + } + bool CCockpitComForm::isFrequenceEqual(double f1, double f2) { return CMathUtils::epsilonEqual(f1, f2); diff --git a/src/blackgui/editors/cockpitcomform.h b/src/blackgui/editors/cockpitcomform.h index 830e11fd4..f8fc64225 100644 --- a/src/blackgui/editors/cockpitcomform.h +++ b/src/blackgui/editors/cockpitcomform.h @@ -103,6 +103,9 @@ namespace BlackGui //! SELCAL value changed (in selector) void onSelcalChanged(); + //! Align the heights + void alignUiElementsHeight(); + //! Compare 2 frequencies (consider epsilon) static bool isFrequenceEqual(double f1, double f2);