mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Fixed several issues detected during testing / review (refs #304)
* MS report 1-5 https://dev.vatsim-germany.org/issues/304#change-1800 * Clang warning https://dev.vatsim-germany.org/boards/22/topics/1982?r=1997#message-1997 * Wrong indexes for dockable widgets, RW: https://dev.vatsim-germany.org/issues/304#note-13 * Fixed wrong offset in Fsuipc class * Improved position handling for floating widgets opened 1st time
This commit is contained in:
@@ -21,38 +21,48 @@ namespace BlackGui
|
||||
this->read();
|
||||
}
|
||||
|
||||
const QString CStyleSheetUtility::fontStyleAsString(const QFont &font)
|
||||
const QString &CStyleSheetUtility::fontStyleAsString(const QFont &font)
|
||||
{
|
||||
static const QString n("normal");
|
||||
static const QString i("italic");
|
||||
static const QString o("oblique");
|
||||
static const QString e;
|
||||
|
||||
switch (font.style())
|
||||
{
|
||||
case QFont::StyleNormal: return "normal";
|
||||
case QFont::StyleItalic: return "italic";
|
||||
case QFont::StyleOblique: return "oblique";
|
||||
default: return "";
|
||||
case QFont::StyleNormal: return n;
|
||||
case QFont::StyleItalic: return i;
|
||||
case QFont::StyleOblique: return o;
|
||||
default: return e;
|
||||
}
|
||||
}
|
||||
|
||||
const QString CStyleSheetUtility::fontWeightAsString(const QFont &font)
|
||||
const QString &CStyleSheetUtility::fontWeightAsString(const QFont &font)
|
||||
{
|
||||
if (font.weight() < static_cast<int>(QFont::Normal))
|
||||
{
|
||||
return "light";
|
||||
static const QString l("light");
|
||||
return l;
|
||||
}
|
||||
else if (font.weight() < static_cast<int>(QFont::DemiBold))
|
||||
{
|
||||
return "normal";
|
||||
static const QString n("normal");
|
||||
return n;
|
||||
}
|
||||
else if (font.weight() < static_cast<int>(QFont::Bold))
|
||||
{
|
||||
return "demibold";
|
||||
static const QString d("demibold");
|
||||
return d;
|
||||
}
|
||||
else if (font.weight() < static_cast<int>(QFont::Black))
|
||||
{
|
||||
return "bold";
|
||||
static const QString b("bold");
|
||||
return b;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "black";
|
||||
static const QString b("black");
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user