mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
filebrowser: use getItemColors function
Origin commit data
------------------
Branch: ni/coolstream
Commit: e9d8ab8a5e
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-10-19 (Wed, 19 Oct 2016)
Origin message was:
------------------
- filebrowser: use getItemColors function
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1167,38 +1167,32 @@ void CFileBrowser::hide()
|
|||||||
void CFileBrowser::paintItem(unsigned int pos)
|
void CFileBrowser::paintItem(unsigned int pos)
|
||||||
{
|
{
|
||||||
int colwidth1, colwidth2, colwidth3;
|
int colwidth1, colwidth2, colwidth3;
|
||||||
int c_rad_small = 0;
|
|
||||||
fb_pixel_t color;
|
|
||||||
fb_pixel_t bgcolor;
|
|
||||||
int ypos = y+ theight+0 + pos*fheight;
|
int ypos = y+ theight+0 + pos*fheight;
|
||||||
CFile * actual_file = NULL;
|
CFile * actual_file = NULL;
|
||||||
std::string fileicon;
|
std::string fileicon;
|
||||||
unsigned int curr = liststart + pos;
|
unsigned int currpos = liststart + pos;
|
||||||
|
|
||||||
frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0/*DARK*/);
|
if (currpos >= filelist.size())
|
||||||
|
|
||||||
if (curr >= filelist.size())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
actual_file = &filelist[curr];
|
actual_file = &filelist[currpos];
|
||||||
if (curr == selected)
|
|
||||||
{
|
|
||||||
color = actual_file->Marked ? COL_MENUCONTENTINACTIVE_TEXT : COL_MENUCONTENTSELECTED_TEXT;
|
|
||||||
bgcolor = actual_file->Marked ? COL_MENUCONTENTSELECTED_PLUS_2 : COL_MENUCONTENTSELECTED_PLUS_0;
|
|
||||||
c_rad_small = RADIUS_SMALL;
|
|
||||||
}
|
|
||||||
else if (actual_file->Marked)
|
|
||||||
{
|
|
||||||
color = COL_MENUCONTENT_TEXT;
|
|
||||||
bgcolor = COL_MENUCONTENT_PLUS_2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
color = COL_MENUCONTENT_TEXT;//DARK;
|
|
||||||
bgcolor = COL_MENUCONTENT_PLUS_0;//DARK;
|
|
||||||
}
|
|
||||||
|
|
||||||
frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, c_rad_small);
|
bool i_selected = currpos == selected;
|
||||||
|
bool i_marked = actual_file->Marked;
|
||||||
|
bool i_switch = false; //(currpos < filelist.size()) && (pos & 1);
|
||||||
|
int i_radius = RADIUS_NONE;
|
||||||
|
|
||||||
|
fb_pixel_t color;
|
||||||
|
fb_pixel_t bgcolor;
|
||||||
|
|
||||||
|
getItemColors(color, bgcolor, i_selected, i_marked, i_switch);
|
||||||
|
|
||||||
|
if (i_selected || i_marked)
|
||||||
|
i_radius = RADIUS_LARGE;
|
||||||
|
|
||||||
|
if (i_radius)
|
||||||
|
frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0);
|
||||||
|
frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, i_radius);
|
||||||
|
|
||||||
if (g_settings.filebrowser_showrights == 0 && S_ISREG(actual_file->Mode))
|
if (g_settings.filebrowser_showrights == 0 && S_ISREG(actual_file->Mode))
|
||||||
colwidth2 = 0;
|
colwidth2 = 0;
|
||||||
@@ -1209,7 +1203,7 @@ void CFileBrowser::paintItem(unsigned int pos)
|
|||||||
|
|
||||||
if ( !actual_file->Name.empty() )
|
if ( !actual_file->Name.empty() )
|
||||||
{
|
{
|
||||||
if (curr == selected)
|
if (currpos == selected)
|
||||||
CVFD::getInstance()->showMenuText(0, FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()).c_str(), -1, true); // UTF-8
|
CVFD::getInstance()->showMenuText(0, FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()).c_str(), -1, true); // UTF-8
|
||||||
|
|
||||||
switch(actual_file->getType())
|
switch(actual_file->getType())
|
||||||
|
Reference in New Issue
Block a user