Add a global font scale option in settings window

* This lets the user override the default application font.
* Unfortunately Qt seems to behave inconsistently with font scaling from the
  system, so we take the font size initially from QApplication::font() (which
  doesn't always pick up the font size) and scale from there. While this might
  cause some font scaling to be lost it does mean at least we have a consistent
  scale, as otherwise you get some text scaling and others not.
This commit is contained in:
baldurk
2020-02-12 12:37:09 +00:00
parent ce96d120a4
commit 5e6ec417c1
9 changed files with 332 additions and 238 deletions
@@ -193,6 +193,10 @@ void PersistantConfig::applyValues(const QVariantMap &values)
RENAMED_SETTING(QVariantList, RecentLogFiles, RecentCaptureFiles);
RENAMED_SETTING(QDateTime, DegradedLog_LastUpdate, DegradedCapture_LastUpdate);
RENAMED_SETTING(QVariantList, SPIRVDisassemblers, ShaderProcessors);
// apply reasonable bounds to font scale to avoid invalid values
// 25% - 400%
Font_GlobalScale = qBound(0.25f, Font_GlobalScale, 4.0f);
}
static QMutex RemoteHostLock;