Commit 7d036e8e authored by Sergey Galin's avatar Sergey Galin

Rename: Current => System

parent bc4b3079
......@@ -182,8 +182,8 @@ QAndroidDisplayMetrics::QAndroidDisplayMetrics(
, density_(1.0f)
, densityDpi_(160)
, scaledDensity_(1.0f)
, densityFromCurrentTheme_(1.0f)
, scaledDensityFromCurrentTheme_(1.0f)
, densityFromSystemTheme_(1.0f)
, scaledDensityFromSystemTheme_(1.0f)
, densityFromHardwareDpiTheme_(1.0f)
, scaledDensityFromHardwareDpiTheme_(1.0f)
, physicalXDpi_(160.0f)
......@@ -219,12 +219,12 @@ QAndroidDisplayMetrics::QAndroidDisplayMetrics(
themeFromDensityDpi_ = themeFromLogicalDensity(densityDpi_, allow_intermediate_densities);
themeFromHardwareDpi_ = themeFromHardwareDensity(realisticPhysicalDpi_, allow_intermediate_densities);
densityFromCurrentTheme_ = densityFromTheme(themeFromDensityDpi_);
densityFromSystemTheme_ = densityFromTheme(themeFromDensityDpi_);
densityFromHardwareDpiTheme_ = densityFromTheme(themeFromHardwareDpi_);
const float scale = (density_ > 0.0f) ? (scaledDensity_ / density_) : 1.0f;
scaledDensityFromCurrentTheme_ = densityFromCurrentTheme_ * scale;
scaledDensityFromSystemTheme_ = densityFromSystemTheme_ * scale;
scaledDensityFromHardwareDpiTheme_ = densityFromHardwareDpiTheme_ * scale;
qDebug()
......@@ -236,8 +236,8 @@ QAndroidDisplayMetrics::QAndroidDisplayMetrics(
<< "/ W =" << widthPixels() << "/ H =" << heightPixels()
<< "/ SYSTEM THEME:" << static_cast<int>(themeFromDensityDpi_) << themeDirectoryName()
<< "/ density =" << densityFromCurrentTheme_
<< "/ scaled =" << scaledDensityFromCurrentTheme_
<< "/ density =" << densityFromSystemTheme_
<< "/ scaled =" << scaledDensityFromSystemTheme_
<< "/ HARDWARE THEME:" << static_cast<int>(themeFromHardwareDpi_) << themeDirectoryName(themeFromHardwareDpi_)
<< "/ density =" << densityFromHardwareDpiTheme_
......
......@@ -74,8 +74,8 @@ private:
Q_PROPERTY(float density READ density)
Q_PROPERTY(int densityDpi READ densityDpi)
Q_PROPERTY(float scaledDensity READ scaledDensity)
Q_PROPERTY(float densityFromCurrentTheme READ densityFromCurrentTheme)
Q_PROPERTY(float scaledDensityFromCurrentTheme READ scaledDensityFromCurrentTheme)
Q_PROPERTY(float densityFromSystemTheme READ densityFromSystemTheme)
Q_PROPERTY(float scaledDensityFromSystemTheme READ scaledDensityFromSystemTheme)
Q_PROPERTY(float densityFromHardwareDpiTheme READ densityFromHardwareDpiTheme)
Q_PROPERTY(float scaledDensityFromHardwareDpiTheme READ scaledDensityFromHardwareDpiTheme)
Q_PROPERTY(float xdpi READ xdpi)
......@@ -126,7 +126,7 @@ public:
// This is the number used to scale layout designed for a device with default (medium)
// resolution (160 DPI) to match the current device.
// Note: some devices have wrong density value based on wrong physical DPI value.
// It is safer to use densityFromCurrentTheme() or scaledDensityFromCurrentTheme(),
// It is safer to use densityFromSystemTheme() or scaledDensityFromSystemTheme(),
// especially when supporting older Androids.
float density() const { return density_; }
......@@ -161,8 +161,9 @@ public:
// Workaround function: get screen density exactly matching theme().
// This is more reliable as some older devices have wrong density value, but
// logical DPI is always correct.
// On all properly configured devices the value should be the same as density().
// Old name: densityFromDpi().
float densityFromCurrentTheme() const { return densityFromCurrentTheme_; }
float densityFromSystemTheme() const { return densityFromSystemTheme_; }
// Get screen density for the theme based on the hardware parameters rather than
// the the manufacturer's choice.
......@@ -171,7 +172,7 @@ public:
// Workaround function: get screen densityFromDpi() and apply user setting
// for UI scaling.
// Old name: scaledDensityFromDpi().
float scaledDensityFromCurrentTheme() const { return scaledDensityFromCurrentTheme_; }
float scaledDensityFromSystemTheme() const { return scaledDensityFromSystemTheme_; }
// Get scaled screen density for the theme based on the hardware parameters rather than
// manufacturer's choice.
......@@ -203,8 +204,8 @@ private:
float density_;
int densityDpi_;
float scaledDensity_;
float densityFromCurrentTheme_;
float scaledDensityFromCurrentTheme_;
float densityFromSystemTheme_;
float scaledDensityFromSystemTheme_;
float densityFromHardwareDpiTheme_;
float scaledDensityFromHardwareDpiTheme_;
float physicalXDpi_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment