Fix Username Font Weight Issue on Qt 6 (#4476)

This commit is contained in:
nerix 2023-03-25 11:57:06 +01:00 committed by GitHub
parent 19cc72f927
commit d59076520a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -9,6 +9,7 @@
- Bugfix: Fixed an issue where it was difficult to hover a zero-width emote. (#4314) - Bugfix: Fixed an issue where it was difficult to hover a zero-width emote. (#4314)
- Bugfix: Fixed an issue where context-menu items for zero-width emotes displayed the wrong provider. (#4460) - Bugfix: Fixed an issue where context-menu items for zero-width emotes displayed the wrong provider. (#4460)
- Bugfix: Fixed an issue where the "Enable zero-width emotes" setting was showing the inverse state. (#4462) - Bugfix: Fixed an issue where the "Enable zero-width emotes" setting was showing the inverse state. (#4462)
- Bugfix: Fixed username rendering in Qt 6. (#4476)
- Dev: Disabling precompiled headers on Windows is now tested in CI. (#4472) - Dev: Disabling precompiled headers on Windows is now tested in CI. (#4472)
- Dev: Ignore unhandled BTTV user-events. (#4438) - Dev: Ignore unhandled BTTV user-events. (#4438)
- Dev: Only log debug messages when NDEBUG is not defined. (#4442) - Dev: Only log debug messages when NDEBUG is not defined. (#4442)

View file

@ -25,10 +25,13 @@ namespace chatterino {
namespace { namespace {
int getBoldness() int getBoldness()
{ {
#ifdef CHATTERINO #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return getSettings()->boldScale.getValue(); // This setting uses the Qt 5 range of the font-weight (0..99).
// The range in Qt 6 is 1..1000.
return (int)(1.0 +
(111.0 * getSettings()->boldScale.getValue()) / 11.0);
#else #else
return QFont::Bold; return getSettings()->boldScale.getValue();
#endif #endif
} }
} // namespace } // namespace