diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2013-11-17 17:05:26 +0100 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2013-11-17 17:05:26 +0100 |
commit | a0c769064b4f93f1dbe852f3cfe6150adc809deb (patch) | |
tree | 8d759c2e493939535163d6b04f012bb57577742f /imageloader.c | |
parent | b5993e70b53eb7397fc7af812e737f94513fe3a8 (diff) | |
download | skin-flatplus-a0c769064b4f93f1dbe852f3cfe6150adc809deb.tar.gz skin-flatplus-a0c769064b4f93f1dbe852f3cfe6150adc809deb.tar.bz2 |
use icon from default theme if current theme does not have this icon
Diffstat (limited to 'imageloader.c')
-rw-r--r-- | imageloader.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/imageloader.c b/imageloader.c index 1c0ec688..1b5c3772 100644 --- a/imageloader.c +++ b/imageloader.c @@ -49,8 +49,12 @@ bool cImageLoader::LoadIcon(const char *cIcon, int size) { return false; cString iconThemePath = cString::sprintf("%s%s/", *Config.iconPath, Setup.OSDTheme); bool success = LoadImage(cString(cIcon), iconThemePath, "png"); - if (!success) - return false; + if( !success ) { + iconThemePath = cString::sprintf("%s%s/", *Config.iconPath, "default"); + success = LoadImage(cString(cIcon), iconThemePath, "png"); + if( !success ) + return false; + } if( size >= 0 ) buffer.sample(Geometry(size, size)); return true; @@ -62,8 +66,12 @@ bool cImageLoader::LoadIcon(const char *cIcon, int width, int height, bool prese return false; cString iconThemePath = cString::sprintf("%s%s/", *Config.iconPath, Setup.OSDTheme); bool success = LoadImage(cString(cIcon), iconThemePath, "png"); - if (!success) - return false; + if( !success ) { + iconThemePath = cString::sprintf("%s%s/", *Config.iconPath, "default"); + success = LoadImage(cString(cIcon), iconThemePath, "png"); + if( !success ) + return false; + } if (preserveAspect) { buffer.sample(Geometry(width, height)); } else { |