From a8c4bdb7de0db298beb4c612b8a4f504f5732619 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 25 Oct 2016 11:06:12 +0200 Subject: [PATCH] - listframe/moviebrowser: add round corners to scrollbar --- src/gui/widget/listframe.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) 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)