mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Ref T506, init text message overlay in cockpit/ATC component
This commit is contained in:
committed by
Mat Sutcliffe
parent
eddaeddfc4
commit
d6f3932e5b
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user