mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
Change dimensions and font of xswiftbus message window
This commit is contained in:
@@ -26,7 +26,7 @@ namespace XSwiftBus
|
|||||||
static int lineHeight = 0;
|
static int lineHeight = 0;
|
||||||
if (! lineHeight)
|
if (! lineHeight)
|
||||||
{
|
{
|
||||||
XPLMGetFontDimensions(xplmFont_Proportional, nullptr, &lineHeight, nullptr);
|
XPLMGetFontDimensions(xplmFont_Basic, nullptr, &lineHeight, nullptr);
|
||||||
}
|
}
|
||||||
static const int lineSpace = lineHeight / 3;
|
static const int lineSpace = lineHeight / 3;
|
||||||
const int boxTop = m_screenHeight.get() - m_boxTop;
|
const int boxTop = m_screenHeight.get() - m_boxTop;
|
||||||
@@ -55,7 +55,7 @@ namespace XSwiftBus
|
|||||||
for (int i = 0; i < messageCount; ++i)
|
for (int i = 0; i < messageCount; ++i)
|
||||||
{
|
{
|
||||||
const int y = boxTop - (lineHeight + lineSpace) * (i + 1);
|
const int y = boxTop - (lineHeight + lineSpace) * (i + 1);
|
||||||
XPLMDrawString(m_messages[i].m_rgb.data(), x + arrowWidth + arrowWidth / 2, y, const_cast<char*>(m_messages[i].m_text.c_str()), nullptr, xplmFont_Proportional);
|
XPLMDrawString(m_messages[i].m_rgb.data(), x + arrowWidth + arrowWidth / 2, y, const_cast<char*>(m_messages[i].m_text.c_str()), nullptr, xplmFont_Basic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ namespace XSwiftBus
|
|||||||
if (! len)
|
if (! len)
|
||||||
{
|
{
|
||||||
int charWidth;
|
int charWidth;
|
||||||
XPLMGetFontDimensions(xplmFont_Proportional, &charWidth, nullptr, nullptr);
|
XPLMGetFontDimensions(xplmFont_Basic, &charWidth, nullptr, nullptr);
|
||||||
const int boxRight = m_screenWidth.get() - m_boxRight;
|
const int boxRight = m_screenWidth.get() - m_boxRight;
|
||||||
const int boxLeft = m_boxLeft;
|
const int boxLeft = m_boxLeft;
|
||||||
len = (boxRight - boxLeft - 20) / charWidth;
|
len = (boxRight - boxLeft - 20) / charWidth;
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ namespace XSwiftBus
|
|||||||
void emitAirportsInRangeUpdated(const std::vector<std::string> &icaoCodes, const std::vector<std::string> &names,
|
void emitAirportsInRangeUpdated(const std::vector<std::string> &icaoCodes, const std::vector<std::string> &names,
|
||||||
const std::vector<double> &lats, const std::vector<double> &lons, const std::vector<double> &alts);
|
const std::vector<double> &lats, const std::vector<double> &lons, const std::vector<double> &alts);
|
||||||
|
|
||||||
CMessageBoxControl m_messages { 128, 128, 16 };
|
CMessageBoxControl m_messages { 16, 16, 16 };
|
||||||
std::vector<CNavDataReference> m_airports;
|
std::vector<CNavDataReference> m_airports;
|
||||||
void readAirportsDatabase();
|
void readAirportsDatabase();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user