diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index bed284fa9..c10aa9d3b 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -272,7 +272,7 @@ void CMovieBrowser::clearListLines() m_browserListLines.Icon.clear(); m_browserListLines.marked.clear(); - for (int i = 0; i < 2; i++) + for (int i = 0; i < 3; i++) { m_recordListLines.lineArray[i].clear(); m_playListLines.lineArray[i].clear(); @@ -536,21 +536,29 @@ void CMovieBrowser::initRows(void) { //TRACE("[mb]->%s\n", __func__); + /* + The "last played" / "last recorded" windows have only half the width, so + multiply the relative width with 2 and add 1 percent for safety to date row. + This addition is just usefull for l a r g e font settings. + */ + /***** Last Play List **************/ - m_settings.lastPlayRowNr = 2; + m_settings.lastPlayRowNr = 3; m_settings.lastPlayRow[0] = MB_INFO_TITLE; - m_settings.lastPlayRow[1] = MB_INFO_PREVPLAYDATE; - /* the "last played" / "last recorded" windows have only half the width, so - multiply the relative width with 2 */ - m_settings.lastPlayRowWidth[1] = m_defaultRowWidth[m_settings.lastPlayRow[1]] * 2 + 1; - m_settings.lastPlayRowWidth[0] = 100 - m_settings.lastPlayRowWidth[1]; + m_settings.lastPlayRow[1] = MB_INFO_SPACER; + m_settings.lastPlayRow[2] = MB_INFO_PREVPLAYDATE; + m_settings.lastPlayRowWidth[2] = m_defaultRowWidth[m_settings.lastPlayRow[2]] * 2 + 1; + m_settings.lastPlayRowWidth[1] = m_defaultRowWidth[m_settings.lastPlayRow[1]] * 2; + m_settings.lastPlayRowWidth[0] = 100 - m_settings.lastPlayRowWidth[1] - m_settings.lastPlayRowWidth[2]; /***** Last Record List **************/ - m_settings.lastRecordRowNr = 2; + m_settings.lastRecordRowNr = 3; m_settings.lastRecordRow[0] = MB_INFO_TITLE; - m_settings.lastRecordRow[1] = MB_INFO_RECORDDATE; - m_settings.lastRecordRowWidth[1] = m_defaultRowWidth[m_settings.lastRecordRow[1]] * 2 + 1; - m_settings.lastRecordRowWidth[0] = 100 - m_settings.lastRecordRowWidth[1]; + m_settings.lastRecordRow[1] = MB_INFO_SPACER; + m_settings.lastRecordRow[2] = MB_INFO_RECORDDATE; + m_settings.lastRecordRowWidth[2] = m_defaultRowWidth[m_settings.lastRecordRow[2]] * 2 + 1; + m_settings.lastRecordRowWidth[1] = m_defaultRowWidth[m_settings.lastRecordRow[1]] * 2; + m_settings.lastRecordRowWidth[0] = 100 - m_settings.lastRecordRowWidth[1] - m_settings.lastRecordRowWidth[2]; } void CMovieBrowser::defaultSettings(MB_SETTINGS* /*settings*/) @@ -1337,7 +1345,7 @@ void CMovieBrowser::refreshMovieInfo(void) } if (pic) flogo_w = pic->getWidth(); - m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, m_cBoxFrameInfo.iWidth - flogo_w - 24); + m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, m_cBoxFrameInfo.iWidth - flogo_w - (flogo_w ? 24 : 0)); if (pic) pic->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 41dfc1d7d..aefffc146 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -67,10 +67,6 @@ #define MAX_BROWSER_FRAME_HEIGHT 80 // void strReplace(std::string& orig, const char* fstr, const std::string &rstr); - - - - #define MB_MAX_ROWS LF_MAX_ROWS #define MB_MAX_DIRS NETWORK_NFS_NR_OF_ENTRIES /* MB_SETTINGS to be stored in g_settings anytime ....*/ @@ -94,22 +90,24 @@ typedef struct int browser_serie_mode; int serie_auto_create; + /* these variables are used for the listframes */ int browserFrameHeight; int browserRowNr; - MB_INFO_ITEM browserRowItem[MB_MAX_ROWS];//MB_INFO_ITEM + MB_INFO_ITEM browserRowItem[MB_MAX_ROWS]; int browserRowWidth[MB_MAX_ROWS]; // to be added to config later int lastPlayMaxItems; int lastPlayRowNr; - MB_INFO_ITEM lastPlayRow[2]; - int lastPlayRowWidth[2]; + MB_INFO_ITEM lastPlayRow[3]; + int lastPlayRowWidth[3]; int lastRecordMaxItems; int lastRecordRowNr; - MB_INFO_ITEM lastRecordRow[2]; - int lastRecordRowWidth[2]; + MB_INFO_ITEM lastRecordRow[3]; + int lastRecordRowWidth[3]; + int ytmode; int ytorderby; int ytresults; diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 3e34451d9..01cbcd52c 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -368,21 +368,27 @@ void CListFrame::refreshScroll(void) if( frameBuffer == NULL) return; if(!(m_nMode & SCROLL)) return; - if (m_nNrOfPages > 1) - { - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PASSIVE_PLUS_0); - unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages; - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, - m_cFrameScrollRel.iY + m_nCurrentPage * marker_size +m_cFrame.iY, - m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER), - marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); - } - else + /* + FIXME: Find right conditions. + So long let's paint scrollbar background in every case + to avoid transparent spaces in scrollbar corners. + */ + if (1) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_MENUCONTENT_PLUS_0); } + + if (m_nNrOfPages > 1) + { + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, + m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); + unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*SCROLL_MARKER_BORDER) / m_nNrOfPages; + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, + m_cFrameScrollRel.iY + SCROLL_MARKER_BORDER + m_nCurrentPage * marker_size +m_cFrame.iY, + m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER), + marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); + } } int CListFrame::paintListIcon(int x, int y, int line) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 93358b8e4..a4f719240 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -296,9 +296,9 @@ void CTextBox::initFramesRel(void) if(m_nMode & SCROLL) { m_cFrameScrollRel.iX = m_cFrame.iWidth - SCROLL_FRAME_WIDTH; - m_cFrameScrollRel.iY = m_cFrameTextRel.iY; + m_cFrameScrollRel.iY = m_cFrameTextRel.iY + m_nBgRadius; m_cFrameScrollRel.iWidth = SCROLL_FRAME_WIDTH; - m_cFrameScrollRel.iHeight = m_cFrameTextRel.iHeight; + m_cFrameScrollRel.iHeight = m_cFrameTextRel.iHeight - 2*m_nBgRadius; } else { @@ -494,25 +494,44 @@ void CTextBox::refreshScroll(void) if( frameBuffer == NULL) return; + /* + FIXME: Find right conditions. + So long let's paint scrollbar background in every case + to avoid transparent spaces in scrollbar corners. + */ + if (1) + { + /* + Why we paint scrollbar background seperately? + So we have to reduce roundings from the left side of background. + */ + int BgRadiusType = CORNER_NONE; + if (m_nBgRadiusType == CORNER_ALL) + BgRadiusType = CORNER_RIGHT; + else if (m_nBgRadiusType == CORNER_TOP) + BgRadiusType = CORNER_TOP_RIGHT; + else if (m_nBgRadiusType == CORNER_BOTTOM) + BgRadiusType = CORNER_BOTTOM_RIGHT; + + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrame.iY, + m_cFrameScrollRel.iWidth, m_cFrame.iHeight, + m_textBackgroundColor, m_nBgRadius, BgRadiusType); + } + if (m_nNrOfPages > 1) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, - COL_SCROLLBAR_PASSIVE_PLUS_0); - unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages; - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, - m_cFrameScrollRel.iY + m_nCurrentPage * marker_size+m_cFrame.iY, + COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); + unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*SCROLL_MARKER_BORDER) / m_nNrOfPages; + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER + m_cFrame.iX, + m_cFrameScrollRel.iY + SCROLL_MARKER_BORDER + m_nCurrentPage * marker_size + m_cFrame.iY, m_cFrameScrollRel.iWidth - 2*SCROLL_MARKER_BORDER, - marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); + marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); m_has_scrolled = true; } else - { - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, - m_textBackgroundColor); m_has_scrolled = false; - } } //evaluate comparsion between old and current properties WITHOUT text contents, return true if found changes @@ -570,6 +589,12 @@ void CTextBox::refreshText(void) int dx = m_old_cText != m_cText || m_nNrOfPages>1 ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; int dy = m_cFrameTextRel.iHeight; + //avoid artefacts in transparent cornes + /* + This happens, when text width is smaller then the radius width. + */ + dx = std::max(dx, 2*m_nBgRadius); + //find changes bool has_changed = hasChanged(&ax, &ay, &dx, &dy); @@ -604,10 +629,23 @@ void CTextBox::refreshText(void) bool allow_paint_bg = (m_old_cText != m_cText || has_changed || m_has_scrolled); if (m_nPaintBackground && !m_SaveScreen){ clearScreenBuffer(); - if (allow_paint_bg){ + if (allow_paint_bg) + { + /* + Why we paint scrollbar background seperately? + So we have to reduce roundings from the right side of background. + */ + int BgRadiusType = CORNER_NONE; + if (m_nBgRadiusType == CORNER_ALL) + BgRadiusType = CORNER_LEFT; + else if (m_nBgRadiusType == CORNER_TOP) + BgRadiusType = CORNER_TOP_LEFT; + else if (m_nBgRadiusType == CORNER_BOTTOM) + BgRadiusType = CORNER_BOTTOM_LEFT; + //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); //paint full background only on new text, otherwise paint required background - frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); + frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, BgRadiusType); } } else{