Fixes #1216020, *.font.effect wont get cleared if not defined in style
This commit is contained in:
parent
5324a82b01
commit
acaa583093
2 changed files with 18 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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 @@ 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 {
|
||||
|
|
Loading…
Reference in a new issue