forked from qt-creator/qt-creator
App: Use 'fusion' style only on fractional dpi on Windows
On 200% on 4k screens there is no reason to use the 'fusion' style since the 'vista' native one works perfectly fine. Task-number: QTCREATORBUG-16095 Change-Id: I1ffd02891aa5ef30c0172edd949d63d4270400c4 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -679,10 +679,12 @@ int main(int argc, char **argv)
|
||||
setPixmapCacheLimit();
|
||||
loadFonts();
|
||||
|
||||
if (Utils::HostOsInfo::isWindowsHost() && !qFuzzyCompare(qApp->devicePixelRatio(), 1.0)
|
||||
&& !hasStyleOption) {
|
||||
// On 100% or 200% scaling we can use the default 'Vista' style on Windows
|
||||
qreal tmp;
|
||||
const bool fractionalDpi = !qFuzzyIsNull(std::modf(qApp->devicePixelRatio(), &tmp));
|
||||
if (Utils::HostOsInfo::isWindowsHost() && fractionalDpi && !hasStyleOption)
|
||||
QApplication::setStyle(QLatin1String("fusion"));
|
||||
}
|
||||
|
||||
const int threadCount = QThreadPool::globalInstance()->maxThreadCount();
|
||||
QThreadPool::globalInstance()->setMaxThreadCount(qMax(4, 2 * threadCount));
|
||||
|
||||
|
Reference in New Issue
Block a user