From 721e1aa49134fb55241728528256b8662a5bb160 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 1 May 2013 21:50:06 +0300 Subject: add theme default font size depend on screen density. --- src/defaults.cpp | 6 ++++-- src/gui/theme.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/defaults.cpp b/src/defaults.cpp index 6105e81d2..045b007f0 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -21,13 +21,15 @@ #include "defaults.h" -#include "utils/stringutils.h" - #include "being.h" #include "client.h" #include "graphics.h" +#include "graphicsmanager.h" #include "keydata.h" +#include "utils/stringutils.h" + + #include #include "debug.h" diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 56598ade1..565391ed9 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -1205,6 +1205,8 @@ ThemeInfo *Theme::loadInfo(const std::string &themeName) ThemeInfo *info = new ThemeInfo(); + const std::string fontSize2 = "fontSize_" + mScreenDensity; + const std::string npcfontSize2 = "npcfontSize_" + mScreenDensity; for_each_xml_child_node(infoNode, rootNode) { if (xmlNameEqual(infoNode, "name")) @@ -1227,6 +1229,10 @@ ThemeInfo *Theme::loadInfo(const std::string &themeName) readIntValue(fontSize); else if (xmlNameEqual(infoNode, "npcfontSize")) readIntValue(npcfontSize); + else if (xmlNameEqual(infoNode, fontSize2.c_str())) + readIntValue(fontSize); + else if (xmlNameEqual(infoNode, npcfontSize2.c_str())) + readIntValue(npcfontSize); } return info; } -- cgit v1.2.3-70-g09d2