diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index b0aeec52c..c895ee3dc 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -279,7 +279,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(); @@ -545,21 +545,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*/) @@ -1177,21 +1185,22 @@ int CMovieBrowser::paint(void) //CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD)); - Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]; //NI + Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]; m_movieSelectionHandler = NULL; + m_pcBrowser = new CListFrame(&m_browserListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE, &m_cBoxFrameBrowserList, NULL, - g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); //NI + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcLastPlay = new CListFrame(&m_playListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE | CListFrame::TITLE, &m_cBoxFrameLastPlayList, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_PLAYLIST), - g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); //NI + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcLastRecord = new CListFrame(&m_recordListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE | CListFrame::TITLE, &m_cBoxFrameLastRecordList, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_RECORDLIST), - g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); //NI + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcFilter = new CListFrame(&m_FilterLines, font, CListFrame::SCROLL | CListFrame::TITLE, &m_cBoxFrameFilter, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_FILTER), - g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); //NI - m_pcInfo = new CTextBox(" ", g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo); //NI + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); + m_pcInfo = new CTextBox(" ", g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo); if (m_pcBrowser == NULL || m_pcLastPlay == NULL || @@ -1434,7 +1443,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 844f5910f..b78953d36 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -68,10 +68,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 ....*/ @@ -95,22 +91,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/osd_setup.cpp b/src/gui/osd_setup.cpp index 07fe819fb..bad2272b1 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -157,7 +157,6 @@ const SNeutrinoSettings::FONT_TYPES menu_font_sizes[] = }; size_t menu_font_items = sizeof(menu_font_sizes)/sizeof(menu_font_sizes[0]); -//NI const SNeutrinoSettings::FONT_TYPES moviebrowser_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD, @@ -180,7 +179,7 @@ font_sizes_groups font_sizes_groups[] = {LOCALE_FONTMENU_EVENTLIST , eventlist_font_items , eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, {LOCALE_FONTMENU_EPG , epg_font_items , epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, {LOCALE_FONTMENU_INFOBAR , infobar_font_items , infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, - {LOCALE_FONTMENU_MOVIEBROWSER,moviebrowser_font_items,moviebrowser_font_sizes,"fontsize.dmbr", LOCALE_MENU_HINT_MOVIEBROWSER_FONTS }, //NI + {LOCALE_FONTMENU_MOVIEBROWSER,moviebrowser_font_items,moviebrowser_font_sizes,"fontsize.dmbr", LOCALE_MENU_HINT_MOVIEBROWSER_FONTS }, {LOCALE_FONTMENU_OTHER , other_font_items , other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } }; #define FONT_GROUP_COUNT (sizeof(font_sizes_groups)/sizeof(font_sizes_groups[0])) @@ -212,9 +211,9 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_INFOBAR_ECMINFO , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI {LOCALE_FONTSIZE_FILEBROWSER_ITEM , 16, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, {LOCALE_FONTSIZE_MENU_HINT , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, - {LOCALE_FONTSIZE_MOVIEBROWSER_HEAD , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, //NI - {LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI - {LOCALE_FONTSIZE_MOVIEBROWSER_INFO , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI + {LOCALE_FONTSIZE_MOVIEBROWSER_HEAD , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, + {LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, + {LOCALE_FONTSIZE_MOVIEBROWSER_INFO , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, {LOCALE_FONTSIZE_SUBTITLES , 25, CNeutrinoFonts::FONT_STYLE_BOLD , 0} }; diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index a2dee004a..15018c984 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{ diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 380f2f844..b75174518 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -1254,7 +1254,7 @@ std::vector split(const std::string &s, char delim) return vec; } -#if __cplusplus <= 201103L +#if __cplusplus < 201103L std::string to_string(int i) { std::stringstream s; diff --git a/src/system/helpers.h b/src/system/helpers.h index a18f495b0..373d82d64 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -119,7 +119,7 @@ class CFileHelpers uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true); -#if __cplusplus <= 201103L +#if __cplusplus < 201103L std::string to_string(int); std::string to_string(unsigned int); std::string to_string(long); diff --git a/src/system/settings.h b/src/system/settings.h index 218a1e09f..96e026ae5 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -679,9 +679,9 @@ struct SNeutrinoSettings FONT_TYPE_INFOBAR_ECMINFO, //NI FONT_TYPE_FILEBROWSER_ITEM, FONT_TYPE_MENU_HINT, - FONT_TYPE_MOVIEBROWSER_HEAD, //NI - FONT_TYPE_MOVIEBROWSER_LIST, //NI - FONT_TYPE_MOVIEBROWSER_INFO, //NI + FONT_TYPE_MOVIEBROWSER_HEAD, + FONT_TYPE_MOVIEBROWSER_LIST, + FONT_TYPE_MOVIEBROWSER_INFO, FONT_TYPE_SUBTITLES, FONT_TYPE_COUNT };