mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
*neutrino menu: colorhandling optimized, was not working nice
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1023 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -113,28 +113,24 @@ void CMenuItem::setItemColors(const bool select_mode, const fb_pixel_t &def_col
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CMenuItem::paintItemBackground (const bool select_mode, const int &item_x, const int &item_y, const int &width, const int &height)
|
||||
{
|
||||
CFrameBuffer *frameBuffer = CFrameBuffer::getInstance();
|
||||
|
||||
if(select_mode)
|
||||
frameBuffer->paintBoxRel(item_x, item_y, width, height, item_bgcolor, RADIUS_LARGE);
|
||||
//else if(last)
|
||||
//else if(last) ?? Why do we need this?
|
||||
//frameBuffer->paintBoxRel(item_x, item_y, width, height, i_bgcolor, RADIUS_LARGE, CORNER_BOTTOM); //FIXME
|
||||
else
|
||||
frameBuffer->paintBoxRel(item_x, item_y, width, height, item_bgcolor);
|
||||
}
|
||||
|
||||
|
||||
void CMenuItem::paintItem(const bool select_mode, int &start_x, int &start_y, int &width, int &height,
|
||||
const fb_pixel_t &def_color, const fb_pixel_t &def_bgcolor,
|
||||
const fb_pixel_t &def_sel_color, const fb_pixel_t &def_sel_bgcolor,
|
||||
const fb_pixel_t &def_inactiv_color, const fb_pixel_t &def_inactiv_bgcolor)
|
||||
void CMenuItem::paintItem(const bool select_mode, int &start_x, int &start_y, int &width, int &height)
|
||||
{
|
||||
//set colors
|
||||
setItemColors(select_mode, def_color, def_bgcolor,
|
||||
def_sel_color, def_sel_bgcolor,
|
||||
def_inactiv_color, def_inactiv_bgcolor);
|
||||
// //set colors
|
||||
// setItemColors(select_mode);
|
||||
|
||||
//paint item background
|
||||
paintItemBackground(select_mode, start_x, start_y, width, height);
|
||||
@@ -802,12 +798,15 @@ void CMenuWidget::paintItems()
|
||||
item->init(x, ypos, width, iconOffset);
|
||||
if( (item->isSelectable()) && (selected==-1) )
|
||||
{
|
||||
item->setItemColors(true);
|
||||
ypos = item->paint(true);
|
||||
selected = count;
|
||||
}
|
||||
else
|
||||
{
|
||||
ypos = item->paint(selected==((signed int) count) );
|
||||
bool sel = selected==((signed int) count) ;
|
||||
item->setItemColors(sel);
|
||||
ypos = item->paint(sel);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -906,6 +905,9 @@ int CMenuOptionNumberChooser::paint(bool selected, bool /*last*/)
|
||||
int stringstartposName = x + offx + 10;
|
||||
int stringstartposOption = x + dx - stringwidth - 10; //+ offx
|
||||
|
||||
//set colors
|
||||
setItemColors(selected);
|
||||
|
||||
//paint item
|
||||
paintItem(selected, x, y, dx, height);
|
||||
|
||||
@@ -1120,6 +1122,9 @@ int CMenuOptionChooser::paint( bool selected , bool /*last*/)
|
||||
int stringstartposName = x + offx + 10;
|
||||
int stringstartposOption = x + dx - stringwidth - 10; //+ offx
|
||||
|
||||
//set colors
|
||||
setItemColors(selected);
|
||||
|
||||
//paint item
|
||||
paintItem(selected, x, y, dx, height);
|
||||
|
||||
@@ -1259,6 +1264,9 @@ int CMenuOptionStringChooser::paint( bool selected, bool /*last*/ )
|
||||
//int stringstartposOption = x + dx - stringwidth - 10; //+ offx
|
||||
int stringstartposOption = x + offx + 10 + 10 + optionwidth;
|
||||
|
||||
//set colors
|
||||
setItemColors(selected);
|
||||
|
||||
//paint item
|
||||
paintItem(selected, x, y, dx, height);
|
||||
|
||||
@@ -1333,6 +1341,9 @@ int CMenuOptionLanguageChooser::paint( bool selected, bool /*last*/ )
|
||||
{
|
||||
active = true;
|
||||
|
||||
//set colors
|
||||
setItemColors(selected);
|
||||
|
||||
//paint item
|
||||
paintItem(selected, x, y, dx, height);
|
||||
|
||||
@@ -1473,6 +1484,9 @@ int CMenuForwarder::paint(bool selected, bool /*last*/)
|
||||
CVFD::getInstance()->showMenuText(0, l_text, -1, true);
|
||||
}
|
||||
|
||||
//set colors
|
||||
setItemColors(selected);
|
||||
|
||||
//paint item
|
||||
paintItem(selected, x, y, dx, height);
|
||||
|
||||
|
@@ -80,8 +80,6 @@ class CMenuItem
|
||||
protected:
|
||||
int x, y, dx, offx;
|
||||
bool used;
|
||||
unsigned char item_color ;
|
||||
fb_pixel_t item_bgcolor ;
|
||||
|
||||
public:
|
||||
bool active;
|
||||
@@ -91,6 +89,8 @@ class CMenuItem
|
||||
std::string iconName;
|
||||
std::string selected_iconName;
|
||||
bool show_marker;
|
||||
fb_pixel_t item_color;
|
||||
fb_pixel_t item_bgcolor;
|
||||
|
||||
|
||||
CMenuItem()
|
||||
@@ -137,11 +137,7 @@ class CMenuItem
|
||||
|
||||
virtual void paintItemBackground (const bool select_mode, const int &x, const int &y, const int &width, const int &height);
|
||||
|
||||
virtual void paintItem(const bool select_mode, int &x, int &y, int &width, int &height ,
|
||||
const fb_pixel_t &def_color = COL_MENUCONTENT, const fb_pixel_t &def_bgcolor = COL_MENUCONTENT_PLUS_0,
|
||||
const fb_pixel_t &def_sel_color = COL_MENUCONTENTSELECTED, const fb_pixel_t &def_sel_bgcolor = COL_MENUCONTENTSELECTED_PLUS_0,
|
||||
const fb_pixel_t &def_inactiv_color = COL_MENUCONTENTINACTIVE, const fb_pixel_t &def_inactiv_bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0);
|
||||
|
||||
virtual void paintItem(const bool select_mode, int &start_x, int &start_y, int &width, int &height);
|
||||
|
||||
virtual void setItemButton(const std::string& icon_Name, const bool is_select_button = false);
|
||||
};
|
||||
|
Reference in New Issue
Block a user