Showing the changes to interface/src/UIUtil.cpp (1 of 2 files). Show all
Unified · Split
| @@ -33,9 +33,8 @@ int UIUtil::getWindowTitleBarHeight(const QWidget* window) { · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | // When setting the font size of a widget in points, the rendered text will be larger |
| 35 | 35 | // on Windows and Linux than on Mac OSX. This is because Windows and Linux use a DPI |
| 36 | −// of 96, while OSX uses 72. | |
| 37 | −// In order to get consistent results across platforms, the font sizes need to be scaled | |
| 38 | −// based on the system DPI. | |
| 36 | +// of 96, while OSX uses 72. In order to get consistent results across platforms, the | |
| 37 | +// font sizes need to be scaled based on the system DPI. | |
| 39 | 38 | // This function will scale the font size of widget and all |
| 40 | 39 | // of its children recursively. |
| 41 | 40 | void UIUtil::scaleWidgetFontSizes(QWidget* widget) { |
| @@ -53,14 +52,7 @@ void UIUtil::scaleWidgetFontSizes(QWidget* widget) { · 11 unmodified lines | ||
| 53 | 52 | |
| 54 | 53 | // Scale fonts based on the native dpi. On Windows, where the native DPI is 96, |
| 55 | 54 | // the scale will be: 72.0 / 96.0 = 0.75 |
| 56 | − float fontScale = (BASE_DPI / NATIVE_DPI); | |
| 57 | − | |
| 58 | − // Scale the font further by the system's DPI settings. If using a 2x high-dpi screen | |
| 59 | − // on Windows, for example, the font will be further scaled by: 192.0 / 96.0 = 2.0 | |
| 60 | − // This would give a final scale of: 0.75 * 2.0 = 1.5 | |
| 61 | − // fontScale *= (glCanvas->logicalDpiX() / NATIVE_DPI); | |
| 62 | − | |
| 63 | − qDebug() << "Scaling widgets by: " << fontScale; | |
| 55 | + float fontScale = BASE_DPI / NATIVE_DPI; | |
| 64 | 56 | |
| 65 | 57 | internalScaleWidgetFontSizes(widget, fontScale); |
| 66 | 58 | } |