diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 81ef69643..8fa87ef58 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1522,10 +1522,9 @@ void CMovieBrowser::refreshDetailsLine(int pos) int fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]->getHeight(); int hheight = m_pcBrowser->getHeaderListHeight(); int theight = m_pcBrowser->getTitleHeight(); - int bheight = 8 /*TEXT_BORDER_WIDTH*/; int xpos = m_cBoxFrameBrowserList.iX - ConnectLineBox_Width; - int ypos1 = m_cBoxFrameBrowserList.iY + hheight + theight + bheight + pos*fheight + (fheight/2); + int ypos1 = m_cBoxFrameBrowserList.iY + hheight + theight + OFFSET_INNER_MID + pos*fheight + (fheight/2); int ypos2 = m_cBoxFrameInfo1.iY + (m_cBoxFrameInfo1.iHeight/2); if (m_detailsLine == NULL) @@ -1558,8 +1557,8 @@ void CMovieBrowser::info_hdd_level(bool paint_hdd) pb.setValues(blocks_percent_used, 100); pb.paint(false); } - } + void CMovieBrowser::refreshLCD(void) { if (m_vMovieInfo.empty() || m_movieSelectionHandler == NULL) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index b2a0028d4..4b9495fba 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -55,10 +55,7 @@ #include "listframe.h" #include -#define TEXT_BORDER_WIDTH 8 -#define ROW_BORDER_WIDTH 4 -#define SCROLL_FRAME_WIDTH 10 -#define SCROLL_MARKER_BORDER 2 +#define SCROLL_FRAME_WIDTH 10 #define MAX_WINDOW_WIDTH (frameBuffer->getScreenWidth() - 40) #define MAX_WINDOW_HEIGHT (frameBuffer->getScreenHeight() - 40) @@ -206,7 +203,7 @@ void CListFrame::reSizeMainFrameWidth(int textWidth) { //TRACE("[CListFrame]->ReSizeMainFrameWidth: %d, current: %d\r\n",textWidth,m_cFrameListRel.iWidth); - int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*TEXT_BORDER_WIDTH; + int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*OFFSET_INNER_MID; if( iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; if((unsigned int) iNewWindowWidth < MIN_WINDOW_WIDTH) iNewWindowWidth = MIN_WINDOW_WIDTH; @@ -221,7 +218,7 @@ void CListFrame::reSizeMainFrameHeight(int textHeight) { //TRACE("[CListFrame]->ReSizeMainFrameHeight: %d, current: %d\r\n",textHeight,m_cFrameListRel.iHeight); - int iNewWindowHeight = textHeight + 2*TEXT_BORDER_WIDTH; + int iNewWindowHeight = textHeight + 2*OFFSET_INNER_MID; if( iNewWindowHeight > m_nMaxHeight) iNewWindowHeight = m_nMaxHeight; if( iNewWindowHeight < MIN_WINDOW_HEIGHT) iNewWindowHeight = MIN_WINDOW_HEIGHT; @@ -291,7 +288,7 @@ void CListFrame::initFramesRel(void) m_cFrameHeaderListRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; } - m_nLinesPerPage = (m_cFrameListRel.iHeight - (2*TEXT_BORDER_WIDTH)) / m_nFontListHeight; + m_nLinesPerPage = (m_cFrameListRel.iHeight - (2*OFFSET_INNER_MID)) / m_nFontListHeight; } void CListFrame::onNewLineArray(void) @@ -313,7 +310,7 @@ void CListFrame::onNewLineArray(void) { reSizeMainFrameHeight(m_nNrOfLines * m_nFontListHeight); } - m_nLinesPerPage = (m_cFrameListRel.iHeight - (2*TEXT_BORDER_WIDTH)) / m_nFontListHeight; + m_nLinesPerPage = (m_cFrameListRel.iHeight - (2*OFFSET_INNER_MID)) / m_nFontListHeight; if(m_nLinesPerPage <= 0) m_nLinesPerPage = 1; @@ -359,9 +356,9 @@ void CListFrame::refreshTitle(void) m_cFrameTitleRel.iWidth, m_cFrameTitleRel.iHeight, TITLE_BACKGROUND_COLOR, m_nBgRadius, CORNER_TOP); - m_pcFontTitle->RenderString(m_cFrameTitleRel.iX + TEXT_BORDER_WIDTH + m_cFrame.iX, + m_pcFontTitle->RenderString(m_cFrameTitleRel.iX + OFFSET_INNER_MID + m_cFrame.iX, m_cFrameTitleRel.iY + m_cFrameTitleRel.iHeight + m_cFrame.iY, - m_cFrameTitleRel.iWidth - (TEXT_BORDER_WIDTH << 1), + m_cFrameTitleRel.iWidth - (OFFSET_INNER_MID << 1), m_textTitle.c_str(), TITLE_FONT_COLOR); } @@ -387,10 +384,10 @@ void CListFrame::refreshScroll(void) { 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), + unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*OFFSET_INNER_MIN) / m_nNrOfPages; + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + OFFSET_INNER_MIN+m_cFrame.iX, + m_cFrameScrollRel.iY + OFFSET_INNER_MIN + m_nCurrentPage * marker_size +m_cFrame.iY, + m_cFrameScrollRel.iWidth - (2*OFFSET_INNER_MIN), marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); } } @@ -403,7 +400,7 @@ int CListFrame::paintListIcon(int x, int y, int line) frameBuffer->getIconSize(m_pLines->Icon[line].c_str(), &icol_w, &icol_h); if ((icol_w > 0) && (icol_h > 0)) { frameBuffer->paintIcon(m_pLines->Icon[line], x+m_cFrame.iX, y+m_cFrame.iY-m_nFontListHeight, m_nFontListHeight); - xDiff = icol_w + TEXT_BORDER_WIDTH; + xDiff = icol_w + OFFSET_INNER_MID; } } return xDiff; @@ -439,7 +436,7 @@ void CListFrame::refreshLine(int line) fb_pixel_t color, bgcolor; int rel_line = line - m_nCurrentLine; - int y = m_cFrameListRel.iY + TEXT_BORDER_WIDTH + (rel_line*m_nFontListHeight); + int y = m_cFrameListRel.iY + OFFSET_INNER_MID + (rel_line*m_nFontListHeight); int radius = 0; bool selected = (line == m_nSelectedLine && m_showSelection == true); @@ -454,22 +451,22 @@ void CListFrame::refreshLine(int line) m_cFrameListRel.iWidth, m_nFontListHeight, bgcolor, radius); int width; - int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH; + int x = m_cFrameListRel.iX + OFFSET_INNER_MID; y += m_nFontListHeight; int xDiff = paintListIcon(x, y, line); - int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); + int net_width = m_cFrameListRel.iWidth - OFFSET_INNER_SMALL * (m_pLines->rows - 1); for(int row = 0; row < m_pLines->rows; row++) { width = std::min(m_pLines->rowWidth[row] * net_width / 100, - m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH); + m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - OFFSET_INNER_MID); if (row > 0) xDiff = 0; m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY, width-xDiff, m_pLines->lineArray[row][line].c_str(), color); - x += width + ROW_BORDER_WIDTH; + x += width + OFFSET_INNER_SMALL; } } @@ -483,23 +480,23 @@ void CListFrame::refreshHeaderList(void) m_cFrameHeaderListRel.iWidth, m_cFrameHeaderListRel.iHeight, HEADER_LIST_BACKGROUND_COLOR); int width; - int x = m_cFrameHeaderListRel.iX + TEXT_BORDER_WIDTH; + int x = m_cFrameHeaderListRel.iX + OFFSET_INNER_MID; int y = m_cFrameHeaderListRel.iY + m_nFontHeaderListHeight + 2; - int net_width = m_cFrameHeaderListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); + int net_width = m_cFrameHeaderListRel.iWidth - OFFSET_INNER_SMALL * (m_pLines->rows - 1); bool loop = true; for(int row = 0; row < m_pLines->rows && loop == true; row++) { width = m_pLines->rowWidth[row] * net_width / 100; - if (width > m_cFrameHeaderListRel.iWidth - x + m_cFrameHeaderListRel.iX - TEXT_BORDER_WIDTH) + if (width > m_cFrameHeaderListRel.iWidth - x + m_cFrameHeaderListRel.iX - OFFSET_INNER_MID) { - width = m_cFrameHeaderListRel.iWidth - x + m_cFrameHeaderListRel.iX - TEXT_BORDER_WIDTH; + width = m_cFrameHeaderListRel.iWidth - x + m_cFrameHeaderListRel.iX - OFFSET_INNER_MID; //TRACE(" normalize width to %d , x:%d \r\n",width,x); loop = false; } m_pcFontHeaderList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY, width, m_pLines->lineHeader[row].c_str(), HEADER_LIST_FONT_COLOR); - x += width + ROW_BORDER_WIDTH; + x += width + OFFSET_INNER_SMALL; } }