From 9d25ea54a1a21c252622232e0ec959f500e638f3 Mon Sep 17 00:00:00 2001 From: "Vladimir A. Pavlov" Date: Fri, 27 Jul 2012 21:21:00 +0400 Subject: FbTk/ThemeItems.cc: move loading additional font resources to load() The same logic had been already implemented for texture resources. --- src/FbTk/ThemeItems.cc | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/src/FbTk/ThemeItems.cc b/src/FbTk/ThemeItems.cc index ea3703c..774a14d 100644 --- a/src/FbTk/ThemeItems.cc +++ b/src/FbTk/ThemeItems.cc @@ -149,34 +149,30 @@ void ThemeItem::setFromString(const char *str) { cerr<<"Theme: Setting default value"< -void ThemeItem::load(const string *name, const string *altname) { +void ThemeItem::load(const string *o_name, const string *o_altname) { + const string &m_name = o_name ? *o_name : name(); + const string &m_altname = o_altname ? *o_altname : altName(); + + string effect(ThemeManager::instance().resourceValue(m_name+".effect", m_altname+".Effect")); + if (effect == "halo") { + Color halo_color(ThemeManager::instance().resourceValue(m_name+".halo.color", m_altname+".Halo.Color").c_str(), + theme().screenNum()); + + m_value.setHalo(true); + m_value.setHaloColor(halo_color); + } else if (effect == "shadow" ) { + Color shadow_color(ThemeManager::instance().resourceValue(m_name+".shadow.color", m_altname+".Shadow.Color").c_str(), + theme().screenNum()); + + m_value.setShadow(true); + m_value.setShadowColor(shadow_color); + m_value.setShadowOffX(atoi(ThemeManager::instance().resourceValue(m_name+".shadow.x", m_altname+".Shadow.X").c_str())); + m_value.setShadowOffY(atoi(ThemeManager::instance().resourceValue(m_name+".shadow.y", m_altname+".Shadow.Y").c_str())); + } } -- cgit v0.11.2