forked from qt-creator/qt-creator
App/Core: Only set DPI rounding options if default not "Unset"
Instead of making the OS specific decision whether to set DPI rounding options or not in several places, leave the OS specific check to StyleHelper::defaultHighDpiScaleFactorRoundingPolicy() and test for "Unset". Change-Id: I37ab4a0c643d1b1597e5f45496510f2f36f1a386 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -281,7 +281,9 @@ static Utils::QtcSettings *createUserSettings()
|
|||||||
|
|
||||||
static void setHighDpiEnvironmentVariable()
|
static void setHighDpiEnvironmentVariable()
|
||||||
{
|
{
|
||||||
if (Utils::HostOsInfo::isMacHost() || qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY"))
|
if (Utils::StyleHelper::defaultHighDpiScaleFactorRoundingPolicy()
|
||||||
|
== Qt::HighDpiScaleFactorRoundingPolicy::Unset
|
||||||
|
|| qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::unique_ptr<Utils::QtcSettings> settings(createUserSettings());
|
std::unique_ptr<Utils::QtcSettings> settings(createUserSettings());
|
||||||
|
|||||||
@@ -135,7 +135,8 @@ GeneralSettingsWidget::GeneralSettingsWidget()
|
|||||||
form.addRow({Tr::tr("Toolbar style:"), m_toolbarStyleBox, st});
|
form.addRow({Tr::tr("Toolbar style:"), m_toolbarStyleBox, st});
|
||||||
form.addRow({Tr::tr("Language:"), m_languageBox, st});
|
form.addRow({Tr::tr("Language:"), m_languageBox, st});
|
||||||
|
|
||||||
if (!Utils::HostOsInfo::isMacHost()) {
|
if (StyleHelper::defaultHighDpiScaleFactorRoundingPolicy()
|
||||||
|
!= Qt::HighDpiScaleFactorRoundingPolicy::Unset) {
|
||||||
using Policy = Qt::HighDpiScaleFactorRoundingPolicy;
|
using Policy = Qt::HighDpiScaleFactorRoundingPolicy;
|
||||||
m_policyComboBox = new QComboBox;
|
m_policyComboBox = new QComboBox;
|
||||||
m_policyComboBox->addItem(Tr::tr("Round up for .5 and above"), int(Policy::Round));
|
m_policyComboBox->addItem(Tr::tr("Round up for .5 and above"), int(Policy::Round));
|
||||||
|
|||||||
Reference in New Issue
Block a user