summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-16 15:23:01 +0100
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-16 15:23:01 +0100
commite2ab40154d2adfe5549e6aba7fe067173bd9c54a (patch)
tree918b0ac424c40ed2f38535099425e77a151a7595
parenta43f1eeda472fc41b6f64f37f1a11749b6dac75c (diff)
downloadskin-flatplus-e2ab40154d2adfe5549e6aba7fe067173bd9c54a.tar.gz
skin-flatplus-e2ab40154d2adfe5549e6aba7fe067173bd9c54a.tar.bz2
small widget fixes
-rw-r--r--baserender.h2
-rw-r--r--displaymenu.c17
-rw-r--r--displaymenu.h1
3 files changed, 11 insertions, 9 deletions
diff --git a/baserender.h b/baserender.h
index 4cae5fd6..9a63f731 100644
--- a/baserender.h
+++ b/baserender.h
@@ -24,6 +24,8 @@ struct sDecorBorder {
int From;
};
+template<class T> inline T myMax(T a, T b) { return a >= b ? a : b; }
+
class cFlatBaseRender
{
protected:
diff --git a/displaymenu.c b/displaymenu.c
index 00e76aeb..2935d2e0 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -4019,9 +4019,8 @@ int cFlatDisplayMenu::DrawMainMenuWidgetDVBDevices(int wLeft, int wWidth, int Co
strDevice << i << ": " << *(device->DeviceType()) << " - ";
if( i == deviceLiveTV ) {
- strDevice << tr("LiveTV") << "(";
- const cChannel *channel = device->GetCurrentlyTunedTransponder();
- //const cSource *source = (channel) ? Sources.Get(channel->Source()) : NULL;
+ strDevice << tr("LiveTV") << " (";
+ const cChannel *channel = Channels.GetByNumber(device->CurrentChannel());
cString chanName;
if (channel && channel->Number() > 0) {
chanName = channel->Name();
@@ -4032,9 +4031,8 @@ int cFlatDisplayMenu::DrawMainMenuWidgetDVBDevices(int wLeft, int wWidth, int Co
strDevice << ")";
}
else if( recDevices[i] ) {
- strDevice << tr("recording") << "(";
- const cChannel *channel = device->GetCurrentlyTunedTransponder();
- //const cSource *source = (channel) ? Sources.Get(channel->Source()) : NULL;
+ strDevice << tr("recording") << " (";
+ const cChannel *channel = Channels.GetByNumber(device->CurrentChannel());
cString chanName;
if (channel && channel->Number() > 0) {
chanName = channel->Name();
@@ -4044,13 +4042,13 @@ int cFlatDisplayMenu::DrawMainMenuWidgetDVBDevices(int wLeft, int wWidth, int Co
strDevice << *chanName;
strDevice << ")";
} else {
- const cChannel *channel = device->GetCurrentlyTunedTransponder();
+ const cChannel *channel = Channels.GetByNumber(device->CurrentChannel());
if( channel ) {
cString chanName = channel->Name();
if( !strcmp(*chanName, "") )
strDevice << tr("not used");
else
- strDevice << tr("Unknown") << "(" << *chanName << ")";
+ strDevice << tr("Unknown") << " (" << *chanName << ")";
} else
strDevice << tr("not used");
}
@@ -4783,7 +4781,8 @@ int cFlatDisplayMenu::DrawMainMenuWidgetWeather(int wLeft, int wWidth, int Conte
}
contentWidget.AddText(tempMax.c_str(), false, cRect(left, ContentTop, 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml);
contentWidget.AddText(tempMin.c_str(), false, cRect(left, ContentTop + fontTempSml->Height(), 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml);
- left += fontTempSml->Width("XXXXX") + marginItem;
+
+ left += myMax(fontTempSml->Width(tempMax.c_str()), fontTempSml->Width(tempMin.c_str()) ) + marginItem;
img = imgLoader.LoadIcon("widgets/umbrella", fontHeight, fontHeight - marginItem*2);
if( img ) {
diff --git a/displaymenu.h b/displaymenu.h
index adca16c6..ef0257c5 100644
--- a/displaymenu.h
+++ b/displaymenu.h
@@ -3,6 +3,7 @@
#include "baserender.h"
#include "complexcontent.h"
#include <vdr/menu.h>
+#include <vdr/tools.h>
#include <list>
#include <ctype.h>
#include <iostream>