summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2017-08-27 14:49:01 +0200
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2017-08-27 14:49:01 +0200
commit2d5e027d9c7614fa55a670b569d48340e6084515 (patch)
tree84ded381e513f926668f5359e336a0e33371b678
parenta2956312965579c875a0e8963a9039bcc47c5d33 (diff)
downloadskin-flatplus-2d5e027d9c7614fa55a670b569d48340e6084515.tar.gz
skin-flatplus-2d5e027d9c7614fa55a670b569d48340e6084515.tar.bz2
- [update] use std::min & std:max
-rw-r--r--HISTORY3
-rw-r--r--baserender.c16
-rw-r--r--displaychannel.c14
-rw-r--r--displaymenu.c2
-rw-r--r--displaytracks.c6
5 files changed, 21 insertions, 20 deletions
diff --git a/HISTORY b/HISTORY
index 438fc07f..a4574847 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2,7 +2,8 @@ VDR Plugin 'skinflatplus' Revision History
---------------------------------------
201X-XX-XX: Version XXX
-- [fix] '%' sign not shown in menĂ¼ weather widget at certian font
+- [fix] '%' sign not shown in menu weather widget at certian font
+- [update] use std::min & std:max
- [add] support for change color key mapping
- [add] displaychannel show event start time on the left before event title
diff --git a/baserender.c b/baserender.c
index 8a38c8cb..17e2acec 100644
--- a/baserender.c
+++ b/baserender.c
@@ -385,9 +385,9 @@ void cFlatBaseRender::TopBarUpdate(void) {
cString date = ShortDateString(t);
int dateWidth = topBarFontSml->Width(*date);
- Right = TopBarWidth - timeWidth - max(weekdayWidth, dateWidth) - marginItem;
- topBarPixmap->DrawText(cPoint(Right, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, max(weekdayWidth, dateWidth), 0, taRight);
- topBarPixmap->DrawText(cPoint(Right, fontSmlTop + topBarFontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, max(weekdayWidth, dateWidth), 0, taRight);
+ Right = TopBarWidth - timeWidth - std::max(weekdayWidth, dateWidth) - marginItem;
+ topBarPixmap->DrawText(cPoint(Right, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, std::max(weekdayWidth, dateWidth), 0, taRight);
+ topBarPixmap->DrawText(cPoint(Right, fontSmlTop + topBarFontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, std::max(weekdayWidth, dateWidth), 0, taRight);
int middleWidth = 0;
int numConflicts = 0;
@@ -462,7 +462,7 @@ void cFlatBaseRender::TopBarUpdate(void) {
int extra1Width = topBarFontSml->Width(tobBarTitleExtra1);
int extra2Width = topBarFontSml->Width(tobBarTitleExtra2);
- int extraMaxWidth = max(extra1Width, extra2Width);
+ int extraMaxWidth = std::max(extra1Width, extra2Width);
middleWidth += extraMaxWidth;
Right -= extraMaxWidth + marginItem;
@@ -1106,8 +1106,8 @@ void cFlatBaseRender::ScrollbarDraw(cPixmap *Pixmap, int Left, int Top, int Heig
if( !Pixmap )
return;
- int scrollHeight = max(int((Height) * double(Shown) / Total + 0.5), 5);
- int scrollTop = min(int(Top + (Height) * double(Offset) / Total + 0.5), Top + Height - scrollHeight);
+ int scrollHeight = std::max(int((Height) * double(Shown) / Total + 0.5), 5);
+ int scrollTop = std::min(int(Top + (Height) * double(Offset) / Total + 0.5), Top + Height - scrollHeight);
/* Types
* 0 = left line + rect bar
@@ -1697,8 +1697,8 @@ void cFlatBaseRender::DrawWidgetWeather(void) {
int left = marginItem;
- int widthTempToday = max(weatherFontSml->Width(tempMaxToday.c_str()), weatherFontSml->Width(tempMinToday.c_str()) );
- int widthTempTomorrow = max(weatherFontSml->Width(tempMaxTomorrow.c_str()), weatherFontSml->Width(tempMinTomorrow.c_str()) );
+ int widthTempToday = std::max(weatherFontSml->Width(tempMaxToday.c_str()), weatherFontSml->Width(tempMinToday.c_str()) );
+ int widthTempTomorrow = std::max(weatherFontSml->Width(tempMaxTomorrow.c_str()), weatherFontSml->Width(tempMinTomorrow.c_str()) );
int wTop = topBarHeight + Config.decorBorderTopBarSize*2 + 20 + Config.decorBorderChannelEPGSize;
int wWidth = marginItem + weatherFont->Width(tempToday.c_str()) + weatherFontSign->Width(tempTodaySign.c_str()) + marginItem*2 + weatherFont->Height() + marginItem \
diff --git a/displaychannel.c b/displaychannel.c
index ef9048db..d6fd6945 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -41,7 +41,7 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) {
heightBottom = (fontHeight*2) + (fontSmlHeight*2) + marginItem; // Top, Buttom, Between
heightImageLogo = heightBottom;
if( Config.SignalQualityShow )
- heightBottom += max(fontSmlHeight, (Config.decorProgressSignalSize*2) + marginItem) + marginItem;
+ heightBottom += std::max(fontSmlHeight, (Config.decorProgressSignalSize*2) + marginItem) + marginItem;
else if( Config.ChannelIconsShow )
heightBottom += fontSmlHeight + marginItem;
@@ -367,7 +367,7 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi
epg = Present->Title();
epgShort = Present->ShortText();
- int maxWidth = max(timeStringWidth, seenWidth);
+ int maxWidth = std::max(timeStringWidth, seenWidth);
chanInfoBottomPixmap->DrawText(cPoint(channelWidth - timeStringWidth - marginItem * 2, 0), *timeString,
Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontSml, timeStringWidth, 0, taRight);
@@ -415,7 +415,7 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi
cString dur = cString::sprintf("%d min", Following->Duration() / 60);
int durWidth = fontSml->Width(*dur) + fontSml->Width(" ");
- int maxWidth = max(timeStringWidth, durWidth);
+ int maxWidth = std::max(timeStringWidth, durWidth);
epg = Following->Title();
epgShort = Following->ShortText();
@@ -514,10 +514,10 @@ void cFlatDisplayChannel::SignalQualityDraw(void) {
cFont *SignalFont = cFont::CreateFont(Setup.FontOsd, Config.decorProgressSignalSize);
int top = fontHeight*2 + fontSmlHeight*2 + marginItem;
- top += max(fontSmlHeight, Config.decorProgressSignalSize) - (Config.decorProgressSignalSize*2) - marginItem;
+ top += std::max(fontSmlHeight, Config.decorProgressSignalSize) - (Config.decorProgressSignalSize*2) - marginItem;
int left = marginItem * 2;
int progressTop = fontHeight*2 + fontSmlHeight*2 + marginItem;
- progressTop += max(fontSmlHeight, Config.decorProgressSignalSize) / 2 - Config.decorProgressSignalSize / 2;
+ progressTop += std::max(fontSmlHeight, Config.decorProgressSignalSize) / 2 - Config.decorProgressSignalSize / 2;
progressTop = top;
@@ -585,7 +585,7 @@ void cFlatDisplayChannel::DvbapiInfoDraw(void) {
return;
int top = fontHeight*2 + fontSmlHeight*2 + marginItem;
- top += max(fontSmlHeight, Config.decorProgressSignalSize) - (Config.decorProgressSignalSize*2) - marginItem*2;
+ top += std::max(fontSmlHeight, Config.decorProgressSignalSize) - (Config.decorProgressSignalSize*2) - marginItem*2;
int left = BitrateRight + marginItem * 2;
if (BitrateRight == 0 )
left = SignalStrengthRight + marginItem * 2;
@@ -675,7 +675,7 @@ void cFlatDisplayChannel::PreLoadImages(void) {
index++;
}
- height = max(fontSmlHeight, Config.decorProgressSignalSize);
+ height = std::max(fontSmlHeight, Config.decorProgressSignalSize);
imgLoader.LoadIcon("crypted", 999, height);
imgLoader.LoadIcon("uncrypted", 999, height);
imgLoader.LoadIcon("unknown_asp", 999, height);
diff --git a/displaymenu.c b/displaymenu.c
index 56db135c..8a52adbc 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -2022,7 +2022,7 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index,
Left += fontHeight + marginItem;
}
- //int Minutes = max(0, (Recording->LengthInSeconds() + 30) / 60);
+ //int Minutes = std::max(0, (Recording->LengthInSeconds() + 30) / 60);
int Minutes = (Recording->LengthInSeconds() + 30) / 60;
cString Length = cString::sprintf("%02d:%02d", Minutes / 60, Minutes % 60);
buffer = cString::sprintf("%s %s %s ", *ShortDateString(Recording->Start()), *TimeString(Recording->Start()), *Length);
diff --git a/displaytracks.c b/displaytracks.c
index 5db0bc31..7e9527e1 100644
--- a/displaytracks.c
+++ b/displaytracks.c
@@ -15,15 +15,15 @@ cFlatDisplayTracks::cFlatDisplayTracks(const char *Title, int NumTracks, const c
if( img_stereo )
stereoWidth = img_stereo->Width();
- int imgWidthMax = max(ac3Width, stereoWidth);
+ int imgWidthMax = std::max(ac3Width, stereoWidth);
itemHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderTrackSize*2;
currentIndex = -1;
maxItemWidth = font->Width(Title) + marginItem*4;
for (int i = 0; i < NumTracks; i++)
- maxItemWidth = max(maxItemWidth, font->Width(Tracks[i]) + marginItem*2);
+ maxItemWidth = std::max(maxItemWidth, font->Width(Tracks[i]) + marginItem*2);
int headerWidth = font->Width(Title) + font->Width(" ") + imgWidthMax;
- maxItemWidth = max(maxItemWidth, headerWidth);
+ maxItemWidth = std::max(maxItemWidth, headerWidth);
itemsHeight = (NumTracks+1) * itemHeight;
int left = osdWidth - maxItemWidth;