diff options
author | Michele Calgaro <[email protected]> | 2021-10-04 17:04:23 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2021-10-07 10:37:30 +0900 |
commit | a1a836e148f3d58ce1e330b3d2b2dca5b151d44a (patch) | |
tree | c310123319a89ad3bba425811e722001318943b0 /kcontrol/krdb/krdb.cpp | |
parent | 619ac6d9ff32c28c1e67662ed31767cfd8d99399 (diff) | |
download | tdebase-a1a836e148f3d58ce1e330b3d2b2dca5b151d44a.tar.gz tdebase-a1a836e148f3d58ce1e330b3d2b2dca5b151d44a.zip |
Added support for variable font DPI (range 64-512) in user session.
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit e8d86645043847265b61825c9a1f20a6b93cc924)
Diffstat (limited to 'kcontrol/krdb/krdb.cpp')
-rw-r--r-- | kcontrol/krdb/krdb.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/kcontrol/krdb/krdb.cpp b/kcontrol/krdb/krdb.cpp index d01bd998e..0943a6ccc 100644 --- a/kcontrol/krdb/krdb.cpp +++ b/kcontrol/krdb/krdb.cpp @@ -547,8 +547,21 @@ void runRdb( uint flags ) TDEConfig cfgfonts("kcmfonts", true); cfgfonts.setGroup("General"); - if( cfgfonts.readNumEntry( "forceFontDPI", 0 ) != 0 ) - contents += "Xft.dpi: " + cfgfonts.readEntry( "forceFontDPI" ) + '\n'; + int dpicfg = cfgfonts.readNumEntry("forceFontDPI", 0); + // "forceFontDPIEnable" must be read after "forceFontDPI" to make sure it is + // correctly initialized on the first run when upgrading to the new format, + // without the user even noticying it. The first time "forceFontDPIEnable" + // will not exist and its correct value will be deduced by the existing value + // of "forceFontDPI", which contains the value prior to the update. + bool dpiEnable = cfgfonts.readBoolEntry("forceFontDPIEnable", dpicfg > 0); + if (dpicfg < 64 || dpicfg > 512) + { + dpicfg = 96; + } + if (dpiEnable) + { + contents += "Xft.dpi: " + TQString::number(dpicfg) + '\n'; + } } if (contents.length() > 0) |