Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/scalingconfig.cpp
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 107 | } else { | |||
---|---|---|---|---|---|
114 | } | 114 | } | ||
115 | fontConfigGroup.writeEntry("forceFontDPI", scaleDPI()); | 115 | fontConfigGroup.writeEntry("forceFontDPI", scaleDPI()); | ||
116 | } | 116 | } | ||
117 | 117 | | |||
118 | 118 | | |||
119 | QDialog::accept(); | 119 | QDialog::accept(); | ||
120 | } | 120 | } | ||
121 | 121 | | |||
122 | qreal ScalingConfig::scaleDPI() const | 122 | int ScalingConfig::scaleDPI() const | ||
123 | { | 123 | { | ||
124 | return scaleFactor() * 96.0; | 124 | return qRound(scaleFactor() * 96.0); | ||
hetzenecker: I'd propse
```
qRound(scaleFactor() * 96.0)
```
to get int values. If the scaleFactor is… | |||||
125 | } | 125 | } | ||
126 | 126 | | |||
127 | qreal ScalingConfig::scaleFactor() const | 127 | qreal ScalingConfig::scaleFactor() const | ||
128 | { | 128 | { | ||
129 | return ui.scaleSlider->value() / SLIDER_RATIO; | 129 | return ui.scaleSlider->value() / SLIDER_RATIO; | ||
130 | } | 130 | } | ||
131 | 131 | |
I'd propse
to get int values. If the scaleFactor is rounded, we only get multiplies of 96 as DPI. This means the icon sizes are wrong again