9 #include "ui_cockpitcomponent.h"
22 ui->wip_CockpitComPanelShowHideBar->setVisible(
false);
23 m_minHeightInfoArea = ui->comp_CockpitInfoArea->minimumHeight();
26 &CCockpitComponent::onToggleShowHideDetails, Qt::QueuedConnection);
28 &CCockpitComponent::onRequestTextMessageCom1, Qt::QueuedConnection);
30 &CCockpitComponent::onRequestTextMessageCom2, Qt::QueuedConnection);
37 Q_ASSERT(parentDockableWidget);
39 if (ok && parentDockableWidget)
41 ok = connect(parentDockableWidget, &QDockWidget::topLevelChanged,
this,
42 &CCockpitComponent::onToggleFloating, Qt::QueuedConnection);
51 ui->comp_CockpitComComponent->setTransponderModeStateIdent();
56 ui->comp_CockpitInfoArea->selectArea(CCockpitInfoAreaComponent::InfoAreaAudio);
59 void CCockpitComponent::onToggleShowHideDetails(
bool show)
62 this->toggleShowHideDetails(show,
true);
65 void CCockpitComponent::toggleShowHideDetails(
bool show,
bool considerCurrentSize)
68 Q_ASSERT(this->window());
72 static const QSize defaultSizeShown(500, 600);
73 static const QSize defaultSizeHidden(300, 150);
76 const QSize manuallySetSize = this->window()->size();
79 ui->comp_CockpitInfoArea->setVisible(show);
84 ui->comp_CockpitInfoArea->setMinimumHeight(m_minHeightInfoArea);
85 if (m_sizeFloatingShown.isValid())
87 this->window()->resize(m_sizeFloatingShown);
88 if (considerCurrentSize) { m_sizeFloatingHidden = manuallySetSize; }
93 this->window()->resize(defaultSizeShown);
94 m_sizeFloatingShown = this->window()->size();
99 ui->comp_CockpitInfoArea->setMinimumHeight(0);
100 this->window()->setMinimumSize(defaultSizeHidden);
101 if (m_sizeFloatingHidden.isValid())
103 this->window()->resize(m_sizeFloatingHidden);
104 if (considerCurrentSize) { m_sizeFloatingShown = manuallySetSize; }
109 this->window()->resize(defaultSizeHidden);
110 m_sizeFloatingHidden = this->window()->size();
118 COverlayMessagesFrame::mouseDoubleClickEvent(event);
125 void CCockpitComponent::onATCStationsChanged()
130 void CCockpitComponent::onToggleFloating(
bool floating)
132 ui->wip_CockpitComPanelShowHideBar->setVisible(floating);
140 const QSize sizeMinimum(200, 100);
141 ui->comp_CockpitInfoArea->setVisible(
true);
142 this->window()->setMinimumSize(sizeMinimum);
void requestTextMessageEntryTab(components::TextMessageTab tab)
Request an text message entry.
void toggleShowHide(bool show)
Show or hide cockpit details.
void requestCom1TextMessage()
Request COM text messages.
void requestCom2TextMessage()
Request COM text messages.
Cockpit component: COM unit, show / hide bar, voice rooms.
bool isInfoAreaShown() const
Is the info area shown?
virtual bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget)
Corresponding dockable widget in info area.
void setSelectedTransponderModeStateIdent()
Set to ident (transponder state)
CCockpitComponent(QWidget *parent=nullptr)
Constructor.
virtual void mouseDoubleClickEvent(QMouseEvent *event)
virtual ~CCockpitComponent()
Destructor.
void showAudio()
Show the audio UI.
High level reusable GUI components.