mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- upnpbrowser: use getItemColors function
This commit is contained in:
@@ -949,22 +949,25 @@ void CUpnpBrowserGui::paintDeviceInfo()
|
||||
void CUpnpBrowserGui::paintDevice(unsigned int _pos)
|
||||
{
|
||||
int ypos = m_item_y + _pos*m_item_height;
|
||||
unsigned int pos = m_deviceliststart + _pos;
|
||||
|
||||
bool i_selected = pos == m_selecteddevice;
|
||||
int i_radius = RADIUS_NONE;
|
||||
|
||||
fb_pixel_t color;
|
||||
fb_pixel_t bgcolor;
|
||||
|
||||
unsigned int pos = m_deviceliststart + _pos;
|
||||
if (pos == m_selecteddevice)
|
||||
getItemColors(color, bgcolor, i_selected);
|
||||
|
||||
if (i_selected)
|
||||
{
|
||||
color = COL_MENUCONTENTSELECTED_TEXT;
|
||||
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
||||
paintDeviceInfo();
|
||||
i_radius = RADIUS_LARGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = COL_MENUCONTENT_TEXT;
|
||||
bgcolor = COL_MENUCONTENT_PLUS_0;
|
||||
}
|
||||
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor);
|
||||
|
||||
if (i_radius)
|
||||
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0);
|
||||
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius);
|
||||
|
||||
if (pos >= m_devices.size())
|
||||
return;
|
||||
@@ -1018,27 +1021,28 @@ void CUpnpBrowserGui::paintDevices()
|
||||
void CUpnpBrowserGui::paintItem(std::vector<UPnPEntry> *entries, unsigned int pos, unsigned int selected)
|
||||
{
|
||||
int ypos = m_item_y + pos*m_item_height;
|
||||
|
||||
bool i_selected = pos == selected;
|
||||
int i_radius = RADIUS_NONE;
|
||||
|
||||
fb_pixel_t color;
|
||||
fb_pixel_t bgcolor;
|
||||
|
||||
if (pos == selected)
|
||||
{
|
||||
color = COL_MENUCONTENT_TEXT_PLUS_2;
|
||||
bgcolor = COL_MENUCONTENT_PLUS_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = COL_MENUCONTENT_TEXT;
|
||||
bgcolor = COL_MENUCONTENT_PLUS_0;
|
||||
}
|
||||
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor);
|
||||
getItemColors(color, bgcolor, i_selected);
|
||||
|
||||
if (i_selected)
|
||||
i_radius = RADIUS_LARGE;
|
||||
|
||||
if (i_radius)
|
||||
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0);
|
||||
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius);
|
||||
|
||||
if (pos >= (*entries).size())
|
||||
return;
|
||||
|
||||
UPnPEntry *entry = &(*entries)[pos];
|
||||
|
||||
if (pos == selected)
|
||||
if (i_selected)
|
||||
{
|
||||
paintItemInfo(entry);
|
||||
paintDetails(entry);
|
||||
|
Reference in New Issue
Block a user