This commit is contained in:
kamel5 2021-01-11 11:19:01 +01:00
parent 435a74d9cf
commit 5f4ea6b30d
3 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ cEpgGrid::~cEpgGrid(void) {
void cEpgGrid::SetViewportHeight() { void cEpgGrid::SetViewportHeight() {
int viewportHeightOld = viewportHeight; int viewportHeightOld = viewportHeight;
if ( column->Start() > StartTime() ) { if ( column->Start() > StartTime() ) {
viewportHeight = (min((int)EndTime(), column->Stop()) - column->Start()) /60; viewportHeight = (std::min((int)EndTime(), column->Stop()) - column->Start()) /60;
} else if ( column->Stop() < EndTime() ) { } else if ( column->Stop() < EndTime() ) {
viewportHeight = (column->Stop() - StartTime()) /60; viewportHeight = (column->Stop() - StartTime()) /60;
if (viewportHeight < 0) viewportHeight = 0; if (viewportHeight < 0) viewportHeight = 0;

View File

@ -557,7 +557,7 @@ void cRecMenuItemSelect::Draw(void) {
void cRecMenuItemSelect::DrawValue(void) { void cRecMenuItemSelect::DrawValue(void) {
pixmapVal->Fill(clrTransparent); pixmapVal->Fill(clrTransparent);
std::string textVal = strings[currentVal]; std::string textVal = strings[currentVal];
int iconSize = min(128, height); int iconSize = std::min(128, height);
int textX = width - font->Width(textVal.c_str()) - iconSize; int textX = width - font->Width(textVal.c_str()) - iconSize;
int textY = (height - font->Height()) / 2; int textY = (height - font->Height()) / 2;
pixmapVal->DrawText(cPoint(textX, textY), textVal.c_str(), colorText, clrTransparent, font); pixmapVal->DrawText(cPoint(textX, textY), textVal.c_str(), colorText, clrTransparent, font);
@ -664,7 +664,7 @@ void cRecMenuItemSelectDirectory::Draw(void) {
void cRecMenuItemSelectDirectory::DrawValue(void) { void cRecMenuItemSelectDirectory::DrawValue(void) {
pixmapVal->Fill(clrTransparent); pixmapVal->Fill(clrTransparent);
int iconSize = min(128, height); int iconSize = std::min(128, height);
int textX = std::max(width - font->Width(folders[currentVal].c_str()) - iconSize, 10 + font->Width(*text) + 2 * iconSize); int textX = std::max(width - font->Width(folders[currentVal].c_str()) - iconSize, 10 + font->Width(*text) + 2 * iconSize);
int textY = (height - font->Height()) / 2; int textY = (height - font->Height()) / 2;
pixmapVal->DrawText(cPoint(textX, textY), folders[currentVal].c_str(), colorText, clrTransparent, font, width - textX - iconSize, font->Height(), taTop | taRight); pixmapVal->DrawText(cPoint(textX, textY), folders[currentVal].c_str(), colorText, clrTransparent, font, width - textX - iconSize, font->Height(), taTop | taRight);
@ -967,7 +967,7 @@ char *cRecMenuItemText::GetSMSKeys(int num) {
if (specialChar) if (specialChar)
addition = 1; addition = 1;
Utf8FromArray(startCharUtf8, p, numChars+addition); Utf8FromArray(startCharUtf8, p, numChars+addition);
int maxChars = min(numChars+1+addition, 8); int maxChars = std::min(numChars+1+addition, 8);
char *smskey = new char[maxChars]; char *smskey = new char[maxChars];
Utf8Strn0Cpy(smskey, p, maxChars); Utf8Strn0Cpy(smskey, p, maxChars);
return smskey; return smskey;
@ -2163,7 +2163,7 @@ void cRecMenuItemDayChooser::SetSizes(void) {
if (charWidth > maxWidth) if (charWidth > maxWidth)
maxWidth = charWidth; maxWidth = charWidth;
} }
daysSize = min(maxWidth + 15, height - 4); daysSize = std::min(maxWidth + 15, height - 4);
daysX = width - 10 - 7 * daysSize; daysX = width - 10 - 7 * daysSize;
daysY = (height - daysSize) / 2; daysY = (height - daysSize) / 2;
} }

2
view.c
View File

@ -254,7 +254,7 @@ void cView::DrawFloatingContent(std::string *infoText, cTvMedia *img, cTvMedia *
int textLinesFull = wTextFull.Lines(); int textLinesFull = wTextFull.Lines();
int textHeight = lineHeight * (textLinesTall + textLinesFull) + 2*border; int textHeight = lineHeight * (textLinesTall + textLinesFull) + 2*border;
int yText = border; int yText = border;
CreateContent(max(textHeight, imgHeight + 2*border)); CreateContent(std::max(textHeight, imgHeight + 2*border));
for (int i=0; i < textLinesTall; i++) { for (int i=0; i < textLinesTall; i++) {
pixmapContent->DrawText(cPoint(border, yText), wTextTall.GetLine(i), theme.Color(clrFont), clrTransparent, font); pixmapContent->DrawText(cPoint(border, yText), wTextTall.GetLine(i), theme.Color(clrFont), clrTransparent, font);
yText += lineHeight; yText += lineHeight;