From a0c769064b4f93f1dbe852f3cfe6150adc809deb Mon Sep 17 00:00:00 2001 From: Martin Schirrmacher Date: Sun, 17 Nov 2013 17:05:26 +0100 Subject: use icon from default theme if current theme does not have this icon --- displaychannel.c | 5 +---- imageloader.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/displaychannel.c b/displaychannel.c index 128fa780..559008cc 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -123,10 +123,7 @@ void cFlatDisplayChannel::SetChannel(const cChannel *Channel, int Number) { void cFlatDisplayChannel::ChannelIconsDraw(const cChannel *Channel, bool Resolution) { if( !Resolution ) { chanIconsPixmap->Fill( clrTransparent ); - printf("no resolution\n"); - } else - printf("resolution width: %d\n", screenWidth); - + } int width = fontSmlHeight; int top = fontHeight*2 + fontSmlHeight*2 + marginItem; 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 { -- cgit v1.2.3