mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
Ref T182, mapping / overlay component formatting
This commit is contained in:
@@ -88,8 +88,8 @@ namespace BlackGui
|
|||||||
connect(ui->pb_ResetAircraft, &QPushButton::clicked, this, &CMappingComponent::ps_onResetAircraft);
|
connect(ui->pb_ResetAircraft, &QPushButton::clicked, this, &CMappingComponent::ps_onResetAircraft);
|
||||||
connect(ui->pb_LoadModels, &QPushButton::clicked, this, &CMappingComponent::ps_onModelsUpdateRequested);
|
connect(ui->pb_LoadModels, &QPushButton::clicked, this, &CMappingComponent::ps_onModelsUpdateRequested);
|
||||||
|
|
||||||
this->m_currentMappingsViewDelegate = new CCheckBoxDelegate(":/diagona/icons/diagona/icons/tick.png", ":/diagona/icons/diagona/icons/cross.png", this);
|
m_currentMappingsViewDelegate = new CCheckBoxDelegate(":/diagona/icons/diagona/icons/tick.png", ":/diagona/icons/diagona/icons/cross.png", this);
|
||||||
ui->tvp_RenderedAircraft->setItemDelegateForColumn(0, this->m_currentMappingsViewDelegate);
|
ui->tvp_RenderedAircraft->setItemDelegateForColumn(0, m_currentMappingsViewDelegate);
|
||||||
|
|
||||||
// Aircraft previews
|
// Aircraft previews
|
||||||
connect(ui->cb_AircraftIconDisplayed, &QCheckBox::stateChanged, this, &CMappingComponent::ps_onModelPreviewChanged);
|
connect(ui->cb_AircraftIconDisplayed, &QCheckBox::stateChanged, this, &CMappingComponent::ps_onModelPreviewChanged);
|
||||||
@@ -439,15 +439,15 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CMappingComponent::ps_tokenBucketUpdate()
|
void CMappingComponent::ps_tokenBucketUpdate()
|
||||||
{
|
{
|
||||||
if (!this->m_bucket.tryConsume()) { return; }
|
if (!m_bucket.tryConsume()) { return; }
|
||||||
this->updateRenderedAircraftView(true); // forced update
|
this->updateRenderedAircraftView(true); // forced update
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMappingComponent::ps_settingsChanged()
|
void CMappingComponent::ps_settingsChanged()
|
||||||
{
|
{
|
||||||
const CViewUpdateSettings settings = this->m_settings.get();
|
const CViewUpdateSettings settings = m_settings.get();
|
||||||
const int ms = settings.getRenderingUpdateTime().toMs();
|
const int ms = settings.getRenderingUpdateTime().toMs();
|
||||||
this->m_updateTimer.setInterval(ms);
|
m_updateTimer.setInterval(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMappingComponent::ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
|
void CMappingComponent::ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
|
||||||
@@ -456,11 +456,11 @@ namespace BlackGui
|
|||||||
if (INetwork::isDisconnectedStatus(to))
|
if (INetwork::isDisconnectedStatus(to))
|
||||||
{
|
{
|
||||||
ui->tvp_RenderedAircraft->clear();
|
ui->tvp_RenderedAircraft->clear();
|
||||||
this->m_updateTimer.stop();
|
m_updateTimer.stop();
|
||||||
}
|
}
|
||||||
else if (INetwork::isConnectedStatus(to))
|
else if (INetwork::isConnectedStatus(to))
|
||||||
{
|
{
|
||||||
this->m_updateTimer.start();
|
m_updateTimer.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
void COverlayMessagesFrame::showOverlayMessagesWithConfirmation(
|
void COverlayMessagesFrame::showOverlayMessagesWithConfirmation(
|
||||||
const BlackMisc::CStatusMessageList &messages, bool appendOldMessages,
|
const CStatusMessageList &messages, bool appendOldMessages,
|
||||||
const QString &confirmationMessage, std::function<void ()> okLambda,
|
const QString &confirmationMessage, std::function<void ()> okLambda,
|
||||||
QMessageBox::StandardButton defaultButton, int timeOutMs)
|
QMessageBox::StandardButton defaultButton, int timeOutMs)
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,7 @@ namespace BlackGui
|
|||||||
this->repaint();
|
this->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverlayMessagesFrame::showOverlayMessages(const BlackMisc::CStatusMessageList &messages, bool appendOldMessages, int timeOutMs)
|
void COverlayMessagesFrame::showOverlayMessages(const CStatusMessageList &messages, bool appendOldMessages, int timeOutMs)
|
||||||
{
|
{
|
||||||
if (messages.isEmpty()) { return; }
|
if (messages.isEmpty()) { return; }
|
||||||
this->initInnerFrame();
|
this->initInnerFrame();
|
||||||
@@ -78,7 +78,7 @@ namespace BlackGui
|
|||||||
this->repaint();
|
this->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverlayMessagesFrame::showOverlayTextMessage(const BlackMisc::Network::CTextMessage &textMessage, int timeOutMs)
|
void COverlayMessagesFrame::showOverlayTextMessage(const Network::CTextMessage &textMessage, int timeOutMs)
|
||||||
{
|
{
|
||||||
if (textMessage.isEmpty()) { return; }
|
if (textMessage.isEmpty()) { return; }
|
||||||
this->initInnerFrame();
|
this->initInnerFrame();
|
||||||
@@ -86,14 +86,14 @@ namespace BlackGui
|
|||||||
this->repaint();
|
this->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverlayMessagesFrame::showOverlayVariant(const BlackMisc::CVariant &variant, int timeOutMs)
|
void COverlayMessagesFrame::showOverlayVariant(const CVariant &variant, int timeOutMs)
|
||||||
{
|
{
|
||||||
this->initInnerFrame();
|
this->initInnerFrame();
|
||||||
m_overlayMessages->showOverlayVariant(variant, timeOutMs);
|
m_overlayMessages->showOverlayVariant(variant, timeOutMs);
|
||||||
this->repaint();
|
this->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverlayMessagesFrame::showOverlayImage(const BlackMisc::CPixmap &pixmap, int timeOutMs)
|
void COverlayMessagesFrame::showOverlayImage(const CPixmap &pixmap, int timeOutMs)
|
||||||
{
|
{
|
||||||
this->initInnerFrame();
|
this->initInnerFrame();
|
||||||
m_overlayMessages->showOverlayImage(pixmap, timeOutMs);
|
m_overlayMessages->showOverlayImage(pixmap, timeOutMs);
|
||||||
@@ -130,8 +130,8 @@ namespace BlackGui
|
|||||||
|
|
||||||
int wInner = m_widthFactor * w;
|
int wInner = m_widthFactor * w;
|
||||||
int hInner = m_heightFactor * h;
|
int hInner = m_heightFactor * h;
|
||||||
if (wInner > this->maximumWidth()) wInner = this->maximumWidth();
|
if (wInner > this->maximumWidth()) { wInner = this->maximumWidth(); }
|
||||||
if (hInner > this->maximumHeight()) hInner = this->maximumHeight();
|
if (hInner > this->maximumHeight()) { hInner = this->maximumHeight(); }
|
||||||
return QSize(wInner, hInner);
|
return QSize(wInner, hInner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user