From acaa58309364238371dec1c30d8fe5097843fd57 Mon Sep 17 00:00:00 2001 From: mathias Date: Wed, 15 Jun 2005 06:18:03 +0000 Subject: Fixes #1216020, *.font.effect wont get cleared if not defined in style --- ChangeLog | 3 +++ src/FbTk/Font.cc | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f562273..77f2d11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.14: +*05/06/15: + * Fixes #1216020, *.font.effect wont get cleared if not defined in style (Mathias) + FbTk/Font.cc *05/06/09: * Reordering of the WorkspaceMenu (Mathias) Icon submenu ontop, workspaces below, new|edit|remove on bottom diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc index 365637d..6aa17ea 100644 --- a/src/FbTk/Font.cc +++ b/src/FbTk/Font.cc @@ -160,6 +160,16 @@ typedef std::map FontCache; typedef FontCache::iterator FontCacheIt; FontCache font_cache; + +void resetEffects(FbTk::Font* font) { + font->setHalo(false); + font->setHaloColor(FbTk::Color("white", DefaultScreen(FbTk::App::instance()->display()))); + font->setShadow(false); + font->setShadowColor(FbTk::Color("black", DefaultScreen(FbTk::App::instance()->display()))); + font->setShadowOffY(2); + font->setShadowOffX(2); +} + }; // end nameless namespace @@ -263,6 +273,7 @@ bool Font::load(const std::string &name) { if (name.size() == 0) return false; + bool ret = false; StringMapIt lookup_entry; FontCacheIt cache_entry; @@ -271,6 +282,7 @@ bool Font::load(const std::string &name) { (cache_entry = font_cache.find(lookup_entry->second)) != font_cache.end()) { m_fontstr = cache_entry->first; m_fontimp = cache_entry->second; + resetEffects(this); return true; } @@ -289,6 +301,7 @@ bool Font::load(const std::string &name) { m_fontstr = cache_entry->first; m_fontimp = cache_entry->second; lookup_map[name] = m_fontstr; + resetEffects(this); return true; } @@ -313,13 +326,14 @@ bool Font::load(const std::string &name) { m_fontimp = tmp_font; font_cache[(*name_it)] = tmp_font; m_fontstr = name; + resetEffects(this); return true; } delete tmp_font; } - return false;; + return false; } unsigned int Font::textWidth(const char * const text, unsigned int size) const { -- cgit v0.11.2