all repos — fluxbox @ acaa58309364238371dec1c30d8fe5097843fd57

custom fork of the fluxbox windowmanager

Fixes #1216020, *.font.effect wont get cleared if not defined in style
mathias mathias
commit

acaa58309364238371dec1c30d8fe5097843fd57

parent

5324a82b01c3d15bcb6a0a96bbe6010a4fbca75d

2 files changed, 18 insertions(+), 1 deletions(-)

jump to
M ChangeLogChangeLog

@@ -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
M src/FbTk/Font.ccsrc/FbTk/Font.cc

@@ -160,6 +160,16 @@ typedef std::map<std::string, FbTk::FontImp* > 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 @@

if (name.size() == 0) return false; + bool ret = false; StringMapIt lookup_entry; FontCacheIt cache_entry;

@@ -271,6 +282,7 @@ if ((lookup_entry = lookup_map.find(name)) != lookup_map.end() &&

(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 @@ if ((cache_entry = font_cache.find(*name_it)) != font_cache.end()) {

m_fontstr = cache_entry->first; m_fontimp = cache_entry->second; lookup_map[name] = m_fontstr; + resetEffects(this); return true; }

@@ -313,13 +326,14 @@ lookup_map[name] = (*name_it);

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 {