mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Ref T384, trigger (show) overlay text messages
This commit is contained in:
@@ -65,6 +65,8 @@ namespace BlackGui
|
||||
connect(ui->editor_Com, &CCockpitComForm::testSelcal, this, &CCockpitComComponent::testSelcal);
|
||||
connect(ui->editor_Com, &CCockpitComForm::changedCockpitValues, this, &CCockpitComComponent::updateOwnCockpitInContext);
|
||||
connect(ui->editor_Com, &CCockpitComForm::changedSelcal, this, &CCockpitComComponent::updateSelcalInContext);
|
||||
connect(ui->editor_Com, &CCockpitComForm::requestCom1TextMessage, this, &CCockpitComComponent::requestCom1TextMessage);
|
||||
connect(ui->editor_Com, &CCockpitComForm::requestCom2TextMessage, this, &CCockpitComComponent::requestCom2TextMessage);
|
||||
|
||||
// Relay COM form signals
|
||||
connect(ui->editor_Com, &CCockpitComForm::transponderModeChanged, this, &CCockpitComComponent::transponderModeChanged);
|
||||
|
||||
@@ -59,6 +59,11 @@ namespace BlackGui
|
||||
//! \copydoc BlackGui::Components::CTransponderModeSelector::transponderStateIdentEnded
|
||||
void transponderStateIdentEnded();
|
||||
|
||||
//! Request COM text messages @{
|
||||
void requestCom1TextMessage();
|
||||
void requestCom2TextMessage();
|
||||
//! @}
|
||||
|
||||
protected:
|
||||
//! \copydoc QWidget::paintEvent
|
||||
virtual void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
@@ -22,13 +22,16 @@ namespace BlackGui
|
||||
namespace Components
|
||||
{
|
||||
CCockpitComponent::CCockpitComponent(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
COverlayMessagesFrame(parent),
|
||||
CEnableForDockWidgetInfoArea(),
|
||||
ui(new Ui::CCockpitComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->m_minHeightInfoArea = ui->comp_CockpitInfoArea->minimumHeight();
|
||||
connect(ui->wip_CockpitComPanelShowHideBar, &BlackGui::CShowHideBar::toggleShowHide, this, &CCockpitComponent::onToggleShowHideDetails);
|
||||
|
||||
connect(ui->wip_CockpitComPanelShowHideBar, &CShowHideBar::toggleShowHide, this, &CCockpitComponent::onToggleShowHideDetails);
|
||||
connect(ui->comp_CockpitComComponent, &CCockpitComComponent::requestCom1TextMessage, this, &CCockpitComponent::onRequestTextMessageCom1);
|
||||
connect(ui->comp_CockpitComComponent, &CCockpitComComponent::requestCom2TextMessage, this, &CCockpitComponent::onRequestTextMessageCom2);
|
||||
}
|
||||
|
||||
CCockpitComponent::~CCockpitComponent()
|
||||
@@ -116,6 +119,25 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CCockpitComponent::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event)
|
||||
{
|
||||
this->showOverlayInlineTextMessage(TextMessagesAll);
|
||||
}
|
||||
COverlayMessagesFrame::mouseDoubleClickEvent(event);
|
||||
}
|
||||
|
||||
void CCockpitComponent::onRequestTextMessageCom1()
|
||||
{
|
||||
this->showOverlayInlineTextMessage(TextMessagesCom1);
|
||||
}
|
||||
|
||||
void CCockpitComponent::onRequestTextMessageCom2()
|
||||
{
|
||||
this->showOverlayInlineTextMessage(TextMessagesCom2);
|
||||
}
|
||||
|
||||
void CCockpitComponent::onToggleFloating(bool floating)
|
||||
{
|
||||
ui->wip_CockpitComPanelShowHideBar->setVisible(floating);
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
#ifndef BLACKGUI_COMPONENTS_COCKPITCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_COCKPITCOMPONENT_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||
#include "blackgui/overlaymessagesframe.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QScopedPointer>
|
||||
#include <QSize>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui { class CCockpitComponent; }
|
||||
namespace BlackGui
|
||||
@@ -28,7 +29,8 @@ namespace BlackGui
|
||||
{
|
||||
//! Cockpit component: COM unit, show / hide bar, voice rooms
|
||||
class BLACKGUI_EXPORT CCockpitComponent :
|
||||
public QWidget,
|
||||
// making a widget overlay and dock widget is semi-optimal but a special case here because of text messages
|
||||
public COverlayMessagesFrame,
|
||||
public CEnableForDockWidgetInfoArea
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -53,6 +55,10 @@ namespace BlackGui
|
||||
//! Show the audio UI
|
||||
void showAudio();
|
||||
|
||||
protected:
|
||||
//! \copydoc QWidget::mouseDoubleClickEvent
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||
|
||||
private:
|
||||
//! Show or hide cockpit details
|
||||
void onToggleShowHideDetails(bool show);
|
||||
@@ -60,9 +66,14 @@ namespace BlackGui
|
||||
//! Toggle floating
|
||||
void onToggleFloating(bool floating);
|
||||
|
||||
// toggle area on show/hide details
|
||||
//! Toggle area on show/hide details
|
||||
void toggleShowHideDetails(bool show, bool considerCurrentSize);
|
||||
|
||||
//! Request text message COM1 @{
|
||||
void onRequestTextMessageCom1();
|
||||
void onRequestTextMessageCom2();
|
||||
//! @}
|
||||
|
||||
QScopedPointer<Ui::CCockpitComponent> ui;
|
||||
QSize m_sizeFloatingShown; //! size when info area is shown
|
||||
QSize m_sizeFloatingHidden; //! size when info area is hidden
|
||||
|
||||
Reference in New Issue
Block a user