From 682b4b141ce2d62ec830035533da3e40c2ee487e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 9 May 2014 22:02:53 +0200 Subject: [PATCH] widget/listbox.cpp use paintButtons in foot --- src/gui/widget/listbox.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 236f4137e..12f711cf8 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -26,6 +26,7 @@ #endif #include +#include #include #include @@ -88,22 +89,16 @@ void CListBox::paintHead() void CListBox::paintFoot() { - int ButtonWidth = width / 4; - //frameBuffer->paintBoxRel(x,y+height, width,ButtonHeight, COL_MENUHEAD_PLUS_0); - frameBuffer->paintBoxRel(x, y+height, width, ButtonHeight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round - frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); +const struct button_label ListButtons[] = +{ + { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_CHANNELLIST_EDIT }, + { NEUTRINO_ICON_BUTTON_RED, LOCALE_BOUQUETEDITOR_ADD}, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_BOUQUETEDITOR_DELETE}, + { NEUTRINO_ICON_BUTTON_HOME, LOCALE_BOUQUETEDITOR_RETURN } +}; + const short numbuttons = sizeof(ListButtons)/sizeof(ListButtons[0]); + ::paintButtons(x, y + height-ButtonHeight, width, numbuttons, ListButtons, width, ButtonHeight); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 4* ButtonWidth+ 8, y+height+1); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 4* ButtonWidth+ 38, y+height+24 - 2, width, "edit", COL_INFOBAR_TEXT); - - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x+width- 3* ButtonWidth+ 8, y+height+4); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 29, y+height+24 - 2, width- 26, "add", COL_INFOBAR_TEXT); - - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x+width- 2* ButtonWidth+ 8, y+height+4); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 2* ButtonWidth+ 29, y+height+24 - 2, width- 26, "remove", COL_INFOBAR_TEXT); - - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HOME, x+width - ButtonWidth+ 8, y+height+1); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width - ButtonWidth+ 38, y+height+24 - 2, width, "ready", COL_INFOBAR_TEXT); } void CListBox::paintItem(int pos)