- upnpbrowser: use getItemColors function

This commit is contained in:
svenhoefer
2016-10-19 10:06:36 +02:00
parent a38158919d
commit d1eb35569e

View File

@@ -949,22 +949,25 @@ void CUpnpBrowserGui::paintDeviceInfo()
void CUpnpBrowserGui::paintDevice(unsigned int _pos) void CUpnpBrowserGui::paintDevice(unsigned int _pos)
{ {
int ypos = m_item_y + _pos*m_item_height; 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 color;
fb_pixel_t bgcolor; fb_pixel_t bgcolor;
unsigned int pos = m_deviceliststart + _pos; getItemColors(color, bgcolor, i_selected);
if (pos == m_selecteddevice)
if (i_selected)
{ {
color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
paintDeviceInfo(); paintDeviceInfo();
i_radius = RADIUS_LARGE;
} }
else
{ if (i_radius)
color = COL_MENUCONTENT_TEXT; m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0);
bgcolor = COL_MENUCONTENT_PLUS_0; m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius);
}
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor);
if (pos >= m_devices.size()) if (pos >= m_devices.size())
return; return;
@@ -1018,27 +1021,28 @@ void CUpnpBrowserGui::paintDevices()
void CUpnpBrowserGui::paintItem(std::vector<UPnPEntry> *entries, unsigned int pos, unsigned int selected) void CUpnpBrowserGui::paintItem(std::vector<UPnPEntry> *entries, unsigned int pos, unsigned int selected)
{ {
int ypos = m_item_y + pos*m_item_height; 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 color;
fb_pixel_t bgcolor; fb_pixel_t bgcolor;
if (pos == selected) getItemColors(color, bgcolor, i_selected);
{
color = COL_MENUCONTENT_TEXT_PLUS_2; if (i_selected)
bgcolor = COL_MENUCONTENT_PLUS_2; i_radius = RADIUS_LARGE;
}
else if (i_radius)
{ m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0);
color = COL_MENUCONTENT_TEXT; m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius);
bgcolor = COL_MENUCONTENT_PLUS_0;
}
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor);
if (pos >= (*entries).size()) if (pos >= (*entries).size())
return; return;
UPnPEntry *entry = &(*entries)[pos]; UPnPEntry *entry = &(*entries)[pos];
if (pos == selected) if (i_selected)
{ {
paintItemInfo(entry); paintItemInfo(entry);
paintDetails(entry); paintDetails(entry);