diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index 1867ec044..1bfc61231 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -64,11 +64,11 @@ namespace BlackGui // SELCAL pairs in cockpit this->ui->frp_ComPanelSelcalBottom->clear(); - connect(this->ui->pb_ComPanelSelcalTest, &QPushButton::clicked, this, &CCockpitComComponent::ps_testSelcal); + connect(this->ui->tb_ComPanelSelcalTest, &QPushButton::clicked, this, &CCockpitComComponent::ps_testSelcal); // COM GUI events - connect(this->ui->pb_ComPanelCom1Toggle, &QPushButton::clicked, this, &CCockpitComComponent::ps_guiChangedCockpitValues); - connect(this->ui->pb_ComPanelCom2Toggle, &QPushButton::clicked, this, &CCockpitComComponent::ps_guiChangedCockpitValues); + connect(this->ui->tb_ComPanelCom1Toggle, &QPushButton::clicked, this, &CCockpitComComponent::ps_guiChangedCockpitValues); + connect(this->ui->tb_ComPanelCom2Toggle, &QPushButton::clicked, this, &CCockpitComComponent::ps_guiChangedCockpitValues); connect(this->ui->ds_ComPanelCom1Active, &QDoubleSpinBox::editingFinished, this, &CCockpitComComponent::ps_guiChangedCockpitValues); connect(this->ui->ds_ComPanelCom2Active, &QDoubleSpinBox::editingFinished, this, &CCockpitComComponent::ps_guiChangedCockpitValues); connect(this->ui->ds_ComPanelCom1Standby, &QDoubleSpinBox::editingFinished, this, &CCockpitComComponent::ps_guiChangedCockpitValues); @@ -102,14 +102,14 @@ namespace BlackGui void CCockpitComComponent::ps_guiChangedCockpitValues() { QObject *sender = QObject::sender(); - if (sender == this->ui->pb_ComPanelCom1Toggle) + if (sender == this->ui->tb_ComPanelCom1Toggle) { if (this->ui->ds_ComPanelCom1Standby->value() == this->ui->ds_ComPanelCom1Active->value()) return; double f = this->ui->ds_ComPanelCom1Active->value(); this->ui->ds_ComPanelCom1Active->setValue(this->ui->ds_ComPanelCom1Standby->value()); this->ui->ds_ComPanelCom1Standby->setValue(f); } - else if (sender == this->ui->pb_ComPanelCom2Toggle) + else if (sender == this->ui->tb_ComPanelCom2Toggle) { if (this->ui->ds_ComPanelCom2Standby->value() == this->ui->ds_ComPanelCom2Active->value()) return; double f = this->ui->ds_ComPanelCom2Active->value(); diff --git a/src/blackgui/components/cockpitcomcomponent.ui b/src/blackgui/components/cockpitcomcomponent.ui index 16b9ed56b..ef54ec9f2 100644 --- a/src/blackgui/components/cockpitcomcomponent.ui +++ b/src/blackgui/components/cockpitcomcomponent.ui @@ -7,7 +7,7 @@ 0 0 292 - 96 + 95 @@ -159,8 +159,8 @@ - - + + Toggle COM 1 standby/active @@ -266,20 +266,6 @@ - - - - Toggle COM 2 standby/active - - - - - - - :/diagona/icons/diagona/icons/arrow-circle-double-135.png:/diagona/icons/diagona/icons/arrow-circle-double-135.png - - - @@ -299,6 +285,20 @@ + + + + Toggle COM 2 standby/active + + + + + + + :/diagona/icons/diagona/icons/arrow-circle-double-135.png:/diagona/icons/diagona/icons/arrow-circle-double-135.png + + + @@ -355,14 +355,7 @@ - - - QFrame::NoFrame - - - QFrame::Plain - - + @@ -435,23 +428,10 @@ 0 - - - QFrame::StyledPanel - - - QFrame::Raised - - + - + - - QFrame::StyledPanel - - - QFrame::Raised - 0 @@ -481,25 +461,19 @@ - - + + 0 0 - - - 16 - 16777215 - - test SELCAL - + test SELCAL @@ -555,9 +529,9 @@ cbp_ComPanelTransponderMode ds_ComPanelCom1Standby ds_ComPanelCom2Standby - pb_ComPanelCom1Toggle - pb_ComPanelCom2Toggle - pb_ComPanelSelcalTest + tb_ComPanelCom1Toggle + tb_ComPanelCom2Toggle + tb_ComPanelSelcalTest diff --git a/src/blackgui/components/cockpitcomponent.cpp b/src/blackgui/components/cockpitcomponent.cpp index 110726e5c..6dfe69eec 100644 --- a/src/blackgui/components/cockpitcomponent.cpp +++ b/src/blackgui/components/cockpitcomponent.cpp @@ -28,7 +28,7 @@ namespace BlackGui ui(new Ui::CCockpitComponent) { ui->setupUi(this); - this->m_minHeightInfoArea = this->ui->comp_CockpitInfoArea->minimumHeight(); + this->m_minHeightInfoArea = ui->comp_CockpitInfoArea->minimumHeight(); connect(ui->wip_CockpitComPanelShowHideBar, &BlackGui::CShowHideBar::toggleShowHide, this, &CCockpitComponent::ps_onToggleShowHideDetails); } @@ -48,12 +48,12 @@ namespace BlackGui bool CCockpitComponent::isInfoAreaShown() const { - return this->ui->wip_CockpitComPanelShowHideBar->isShown(); + return ui->wip_CockpitComPanelShowHideBar->isShown(); } void CCockpitComponent::setSelectedTransponderModeStateIdent() { - this->ui->comp_CockpitComComponent->setSelectedTransponderModeStateIdent(); + ui->comp_CockpitComComponent->setSelectedTransponderModeStateIdent(); } void CCockpitComponent::ps_onToggleShowHideDetails(bool show) @@ -76,12 +76,12 @@ namespace BlackGui QSize manuallySetSize = this->window()->size(); // hide area - this->ui->comp_CockpitInfoArea->setVisible(show); + ui->comp_CockpitInfoArea->setVisible(show); // adjust size if (show) { - this->ui->comp_CockpitInfoArea->setMinimumHeight(m_minHeightInfoArea); + ui->comp_CockpitInfoArea->setMinimumHeight(m_minHeightInfoArea); if (this->m_sizeFloatingShown.isValid()) { this->window()->resize(m_sizeFloatingShown); @@ -96,7 +96,7 @@ namespace BlackGui } else { - this->ui->comp_CockpitInfoArea->setMinimumHeight(0); + ui->comp_CockpitInfoArea->setMinimumHeight(0); this->window()->setMinimumSize(defaultSizeHidden); if (this->m_sizeFloatingHidden.isValid()) { @@ -114,7 +114,7 @@ namespace BlackGui void CCockpitComponent::ps_onToggleFloating(bool floating) { - this->ui->wip_CockpitComPanelShowHideBar->setVisible(floating); + ui->wip_CockpitComPanelShowHideBar->setVisible(floating); if (floating) { // use the toggle method to set the sizes @@ -123,10 +123,9 @@ namespace BlackGui else { const QSize sizeMinimum(200, 100); // set when docked, must fit into parent info area - this->ui->comp_CockpitInfoArea->setVisible(true); + ui->comp_CockpitInfoArea->setVisible(true); this->window()->setMinimumSize(sizeMinimum); } } - } // namespace } // namespace diff --git a/src/blackgui/components/selcalcodeselector.cpp b/src/blackgui/components/selcalcodeselector.cpp index 1e4b6eace..dbfaa8f0c 100644 --- a/src/blackgui/components/selcalcodeselector.cpp +++ b/src/blackgui/components/selcalcodeselector.cpp @@ -26,15 +26,18 @@ namespace BlackGui CSelcalCodeSelector::CSelcalCodeSelector(QWidget *parent) : QFrame(parent), ui(new Ui::CSelcalCodeSelector) { - this->ui->setupUi(this); + ui->setupUi(this); this->resetSelcalCodes(true); this->setValidityHint(); - this->ui->lblp_ValidCodeIcon->setToolTips("valid SELCAL", "invalid SELCAL"); + ui->lblp_ValidCodeIcon->setToolTips("valid SELCAL", "invalid SELCAL"); - bool c; - c = connect(this->ui->cb_SelcalPairs1, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_selcalIndexChanged())); + // limit number of elements: https://forum.qt.io/topic/11315/limit-the-number-of-visible-items-on-qcombobox/6 + ui->cb_SelcalPairs1->setStyleSheet("combobox-popup: 0;"); + ui->cb_SelcalPairs2->setStyleSheet("combobox-popup: 0;"); + + bool c = connect(ui->cb_SelcalPairs1, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_selcalIndexChanged())); Q_ASSERT(c); - c = connect(this->ui->cb_SelcalPairs2, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_selcalIndexChanged())); + c = connect(ui->cb_SelcalPairs2, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_selcalIndexChanged())); Q_ASSERT(c); Q_UNUSED(c); } @@ -44,8 +47,8 @@ namespace BlackGui QString CSelcalCodeSelector::getSelcalCode() const { - QString selcal = this->ui->cb_SelcalPairs1->currentText(); - selcal.append(this->ui->cb_SelcalPairs2->currentText()); + QString selcal = ui->cb_SelcalPairs1->currentText(); + selcal.append(ui->cb_SelcalPairs2->currentText()); return selcal; } @@ -57,12 +60,12 @@ namespace BlackGui void CSelcalCodeSelector::resetSelcalCodes(bool allowEmptyValue) { - this->ui->cb_SelcalPairs1->clear(); - if (allowEmptyValue) this->ui->cb_SelcalPairs1->addItem(" "); - this->ui->cb_SelcalPairs1->addItems(BlackMisc::Aviation::CSelcal::codePairs()); - this->ui->cb_SelcalPairs2->clear(); - if (allowEmptyValue) this->ui->cb_SelcalPairs2->addItem(" "); - this->ui->cb_SelcalPairs2->addItems(BlackMisc::Aviation::CSelcal::codePairs()); + ui->cb_SelcalPairs1->clear(); + if (allowEmptyValue) ui->cb_SelcalPairs1->addItem(" "); + ui->cb_SelcalPairs1->addItems(BlackMisc::Aviation::CSelcal::codePairs()); + ui->cb_SelcalPairs2->clear(); + if (allowEmptyValue) ui->cb_SelcalPairs2->addItem(" "); + ui->cb_SelcalPairs2->addItems(BlackMisc::Aviation::CSelcal::codePairs()); } void CSelcalCodeSelector::setSelcalCode(const QString &selcal) @@ -75,11 +78,11 @@ namespace BlackGui QString s2 = s.right(2); if (BlackMisc::Aviation::CSelcal::codePairs().contains(s1)) { - this->ui->cb_SelcalPairs1->setCurrentText(s1); + ui->cb_SelcalPairs1->setCurrentText(s1); } if (BlackMisc::Aviation::CSelcal::codePairs().contains(s2)) { - this->ui->cb_SelcalPairs2->setCurrentText(s2); + ui->cb_SelcalPairs2->setCurrentText(s2); } } @@ -97,9 +100,9 @@ namespace BlackGui void CSelcalCodeSelector::clear() { - if (this->ui->cb_SelcalPairs1->count() < 1) { this->resetSelcalCodes(true); } - this->ui->cb_SelcalPairs1->setCurrentIndex(0); - this->ui->cb_SelcalPairs2->setCurrentIndex(0); + if (ui->cb_SelcalPairs1->count() < 1) { this->resetSelcalCodes(true); } + ui->cb_SelcalPairs1->setCurrentIndex(0); + ui->cb_SelcalPairs2->setCurrentIndex(0); } void CSelcalCodeSelector::ps_selcalIndexChanged() @@ -110,7 +113,7 @@ namespace BlackGui void CSelcalCodeSelector::setValidityHint() { - this->ui->lblp_ValidCodeIcon->setTicked(this->hasValidCode()); + ui->lblp_ValidCodeIcon->setTicked(this->hasValidCode()); } } // ns } // ns diff --git a/src/blackgui/components/selcalcodeselector.ui b/src/blackgui/components/selcalcodeselector.ui index 89ff9bf7f..d3fe7ba43 100644 --- a/src/blackgui/components/selcalcodeselector.ui +++ b/src/blackgui/components/selcalcodeselector.ui @@ -2,22 +2,8 @@ CSelcalCodeSelector - - - 0 - 0 - 151 - 22 - - - Frame - - - QFrame::StyledPanel - - - QFrame::Raised + SELCAL selector @@ -53,7 +39,7 @@ - :/diagona/icons/diagona/icons/tick-button.png + :/diagona/icons/diagona/icons/tick-button.png @@ -67,7 +53,7 @@ - +