Merge branch 'master' into pu/mp

Origin commit data
------------------
Commit: a70f3cb025
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2017-06-16 (Fri, 16 Jun 2017)
This commit is contained in:
Jacek Jendrzej
2017-06-16 14:19:26 +02:00
21 changed files with 207 additions and 180 deletions

View File

@@ -67,16 +67,10 @@ void CListBox::paint()
paintItem(count);
}
int ypos = y+ theight;
int sb = fheight* listmaxshow;
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0);
int sbc= ((getItemCount()- 1)/ listmaxshow)+ 1;
int sbs= (selected/listmaxshow);
if (sbc < 1)
sbc = 1;
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0);
int total_pages;
int current_page;
getScrollBarData(&total_pages, &current_page, getItemCount(), listmaxshow, selected);
paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, fheight*listmaxshow, total_pages, current_page);
}
void CListBox::paintHead()
@@ -109,8 +103,9 @@ void CListBox::hide()
frameBuffer->paintBackgroundBoxRel(x,y, width,height+ButtonHeight);
}
unsigned int CListBox::getItemCount()
unsigned int CListBox::getItemCount()
{
// WTF? Why a fixed value?
return 10;
}
@@ -128,8 +123,8 @@ void CListBox::paintItem(unsigned int /*itemNr*/, int paintNr, bool pselected)
getItemColors(color, bgcolor, pselected);
frameBuffer->paintBoxRel(x,ypos, width- 15, getItemHeight(), bgcolor);
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 10, ypos+ fheight, width-20, "demo", color);
frameBuffer->paintBoxRel(x,ypos, width - SCROLLBAR_WIDTH, getItemHeight(), bgcolor);
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID, ypos + fheight, width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID, "demo", color);
}
void CListBox::updateSelection(unsigned int newpos)

View File

@@ -54,11 +54,10 @@
#include <stdlib.h>
#include <gui/color.h>
#include "listframe.h"
#include <gui/components/cc.h>
#include <gui/widget/icons.h>
#include <driver/fontrenderer.h>
#define SCROLL_FRAME_WIDTH 10
#define MAX_WINDOW_WIDTH (frameBuffer->getScreenWidth() - 40)
#define MAX_WINDOW_HEIGHT (frameBuffer->getScreenHeight() - 40)
@@ -270,9 +269,9 @@ void CListFrame::initFramesRel(void)
if(m_nMode & SCROLL)
{
m_cFrameScrollRel.iX = m_cFrame.iWidth - SCROLL_FRAME_WIDTH;
m_cFrameScrollRel.iX = m_cFrame.iWidth - SCROLLBAR_WIDTH;
m_cFrameScrollRel.iY = m_cFrameTitleRel.iHeight;
m_cFrameScrollRel.iWidth = SCROLL_FRAME_WIDTH;
m_cFrameScrollRel.iWidth = SCROLLBAR_WIDTH;
m_cFrameScrollRel.iHeight = m_cFrameHeaderListRel.iHeight + m_cFrameListRel.iHeight - m_nBgRadius;
}
else
@@ -384,13 +383,9 @@ void CListFrame::refreshScroll(void)
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_PLUS_0, RADIUS_MIN);
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);
paintScrollBar(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight,
m_nNrOfPages, m_nCurrentPage);
}
}

View File

@@ -61,6 +61,7 @@
#include <system/debug.h>
#include <gui/color.h>
#include "textbox.h"
#include <gui/components/cc.h>
#include <gui/widget/icons.h>
#include <driver/fontrenderer.h>
#ifdef VISUAL_DEBUG
@@ -525,14 +526,9 @@ void CTextBox::refreshScroll(void)
if (m_nNrOfPages > 1)
{
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
paintScrollBar(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight,
COL_SCROLLBAR_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);
m_nNrOfPages, m_nCurrentPage);
m_has_scrolled = true;
}
else