mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
channellist: use CComponentsScrollbar
Origin commit data
------------------
Branch: ni/coolstream
Commit: 21c2076a0e
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-06-15 (Thu, 15 Jun 2017)
Origin message was:
------------------
- channellist: use CComponentsScrollbar
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1899,7 +1899,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
color = COL_MENUCONTENTINACTIVE_TEXT;
|
color = COL_MENUCONTENTINACTIVE_TEXT;
|
||||||
|
|
||||||
if (!firstpaint || i_selected || getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber())
|
if (!firstpaint || i_selected || getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber())
|
||||||
frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, i_radius);
|
frameBuffer->paintBoxRel(x,ypos, width - SCROLLBAR_WIDTH, fheight, bgcolor, i_radius);
|
||||||
|
|
||||||
if(curr < (*chanlist).size()) {
|
if(curr < (*chanlist).size()) {
|
||||||
char nameAndDescription[255];
|
char nameAndDescription[255];
|
||||||
@@ -1953,7 +1953,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
int icon_w = 0;
|
int icon_w = 0;
|
||||||
int icon_h = 0;
|
int icon_h = 0;
|
||||||
int offset_right = OFFSET_INNER_MID;
|
int offset_right = OFFSET_INNER_MID;
|
||||||
int icon_x_right = x + width - 15 - offset_right;
|
int icon_x_right = x + width - SCROLLBAR_WIDTH - offset_right;
|
||||||
|
|
||||||
if (scramble_icon)
|
if (scramble_icon)
|
||||||
{
|
{
|
||||||
@@ -2047,7 +2047,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription);
|
unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription);
|
||||||
unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description);
|
unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description);
|
||||||
|
|
||||||
int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 3*OFFSET_INNER_MID - offset_right; // 15 = scrollbar
|
int max_desc_len = width - numwidth - prg_offset - ch_name_len - SCROLLBAR_WIDTH - 3*OFFSET_INNER_MID - offset_right;
|
||||||
|
|
||||||
if (max_desc_len < 0)
|
if (max_desc_len < 0)
|
||||||
max_desc_len = 0;
|
max_desc_len = 0;
|
||||||
@@ -2061,7 +2061,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
struct tm *pStartZeit = localtime(&p_event->startTime);
|
struct tm *pStartZeit = localtime(&p_event->startTime);
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min);
|
snprintf(tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min);
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 15 - prg_offset - 2*OFFSET_INNER_MID, tmp, ecolor, fheight);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + fheight, width - numwidth - SCROLLBAR_WIDTH - prg_offset - 2*OFFSET_INNER_MID, tmp, ecolor, fheight);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2078,11 +2078,11 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - SCROLLBAR_WIDTH - prg_offset, nameAndDescription, color);
|
||||||
if (g_settings.channellist_epgtext_align_right)
|
if (g_settings.channellist_epgtext_align_right)
|
||||||
{
|
{
|
||||||
// align right
|
// align right
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 15 - offset_right - ch_desc_len, ypos + fheight, ch_desc_len, p_event->description, ecolor);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - SCROLLBAR_WIDTH - offset_right - ch_desc_len, ypos + fheight, ch_desc_len, p_event->description, ecolor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2098,7 +2098,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
pb.paint();
|
pb.paint();
|
||||||
}
|
}
|
||||||
//name
|
//name
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - SCROLLBAR_WIDTH - prg_offset, nameAndDescription, color);
|
||||||
}
|
}
|
||||||
if (!firstpaint && curr == selected)
|
if (!firstpaint && curr == selected)
|
||||||
updateVfd();
|
updateVfd();
|
||||||
@@ -2236,16 +2236,11 @@ void CChannelList::paintBody()
|
|||||||
for(unsigned int count = 0; count < listmaxshow; count++)
|
for(unsigned int count = 0; count < listmaxshow; count++)
|
||||||
paintItem(count, true);
|
paintItem(count, true);
|
||||||
|
|
||||||
const int ypos = y+ theight;
|
int total_pages;
|
||||||
const int sb = height - theight - footerHeight; // paint scrollbar over full height of main box
|
int current_page;
|
||||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PLUS_0);
|
getScrollBarData(&total_pages, ¤t_page, (*chanlist).size(), listmaxshow, selected);
|
||||||
unsigned int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero
|
paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, height - theight - footerHeight, total_pages, current_page);
|
||||||
int sbc= (((*chanlist).size()- 1)/ listmaxshow_tmp)+ 1;
|
|
||||||
const int sbs= (selected/listmaxshow_tmp);
|
|
||||||
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);
|
|
||||||
showChannelLogo();
|
showChannelLogo();
|
||||||
if ((*chanlist).empty())
|
if ((*chanlist).empty())
|
||||||
paintButtonBar(false);
|
paintButtonBar(false);
|
||||||
|
Reference in New Issue
Block a user