From d6f3932e5b200ab91f46794cda7686c08306bf31 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sun, 6 Jan 2019 11:23:29 +0100 Subject: [PATCH] Ref T506, init text message overlay in cockpit/ATC component --- src/blackgui/components/atcstationcomponent.cpp | 2 ++ src/blackgui/components/cockpitcomponent.cpp | 17 +++++++++-------- src/blackgui/components/cockpitcomponent.h | 3 +-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index 9bdd5892f..dc2f3e1b4 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -69,6 +69,8 @@ namespace BlackGui CUpperCaseValidator *ucv = new CUpperCaseValidator(ui->le_AtcStationsOnlineMetar); ui->le_AtcStationsOnlineMetar->setValidator(ucv); + this->deferredActivate(this); + // some icons ui->tb_AtcStationsAtisReload->setIcon(CIcons::atis()); ui->tb_AtcStationsAtisReload->setText("ATIS"); diff --git a/src/blackgui/components/cockpitcomponent.cpp b/src/blackgui/components/cockpitcomponent.cpp index d35e942c5..065e7c235 100644 --- a/src/blackgui/components/cockpitcomponent.cpp +++ b/src/blackgui/components/cockpitcomponent.cpp @@ -22,12 +22,13 @@ namespace BlackGui namespace Components { CCockpitComponent::CCockpitComponent(QWidget *parent) : - COverlayMessagesFrame(parent), + QFrame(parent), CEnableForDockWidgetInfoArea(), ui(new Ui::CCockpitComponent) { ui->setupUi(this); - this->m_minHeightInfoArea = ui->comp_CockpitInfoArea->minimumHeight(); + m_minHeightInfoArea = ui->comp_CockpitInfoArea->minimumHeight(); + this->deferredActivate(this); connect(ui->wip_CockpitComPanelShowHideBar, &CShowHideBar::toggleShowHide, this, &CCockpitComponent::onToggleShowHideDetails); connect(ui->comp_CockpitComComponent, &CCockpitComComponent::requestCom1TextMessage, this, &CCockpitComponent::onRequestTextMessageCom1); @@ -89,32 +90,32 @@ namespace BlackGui if (show) { ui->comp_CockpitInfoArea->setMinimumHeight(m_minHeightInfoArea); - if (this->m_sizeFloatingShown.isValid()) + if (m_sizeFloatingShown.isValid()) { this->window()->resize(m_sizeFloatingShown); - if (considerCurrentSize) { this->m_sizeFloatingHidden = manuallySetSize; } // for next time + if (considerCurrentSize) { m_sizeFloatingHidden = manuallySetSize; } // for next time } else { // manually setting size, all other approaches failed this->window()->resize(defaultSizeShown); - this->m_sizeFloatingShown = this->window()->size(); + m_sizeFloatingShown = this->window()->size(); } } else { ui->comp_CockpitInfoArea->setMinimumHeight(0); this->window()->setMinimumSize(defaultSizeHidden); - if (this->m_sizeFloatingHidden.isValid()) + if (m_sizeFloatingHidden.isValid()) { this->window()->resize(m_sizeFloatingHidden); - if (considerCurrentSize) { this->m_sizeFloatingShown = manuallySetSize; } + if (considerCurrentSize) { m_sizeFloatingShown = manuallySetSize; } } else { // manually setting size, all other approaches failed this->window()->resize(defaultSizeHidden); - this->m_sizeFloatingHidden = this->window()->size(); + m_sizeFloatingHidden = this->window()->size(); } } } diff --git a/src/blackgui/components/cockpitcomponent.h b/src/blackgui/components/cockpitcomponent.h index d0646cbf1..ac98ce84c 100644 --- a/src/blackgui/components/cockpitcomponent.h +++ b/src/blackgui/components/cockpitcomponent.h @@ -29,8 +29,7 @@ namespace BlackGui { //! Cockpit component: COM unit, show / hide bar, voice rooms class BLACKGUI_EXPORT CCockpitComponent : - // making a widget overlay and dock widget is semi-optimal but a special case here because of text messages - public COverlayMessagesFrame, + public QFrame, public CEnableForDockWidgetInfoArea { Q_OBJECT