From 9ec912e1a7e20b7bcba33154eb291e5ea3d38b65 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 27 Jun 2013 14:03:34 +0200 Subject: [PATCH] pluginlist: using CComponentsHeader to paint header * fix scrollbar painting Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b1f2f4dc98d99e5034cc1a66827ffebe503c90b5 Author: vanhofen Date: 2013-06-27 (Thu, 27 Jun 2013) Origin message was: ------------------ - pluginlist: using CComponentsHeader to paint header * fix scrollbar painting --- src/gui/pluginlist.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index dfa8f6bd6..c74ab285e 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -301,23 +302,18 @@ void CPluginList::paintItem(int pos) void CPluginList::paintHead() { - if(listmaxshow > pluginlist.size()+1) - frameBuffer->paintBoxRel(x,y, width,theight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - else - frameBuffer->paintBoxRel(x,y, width+15,theight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); + int h_width = width; + if (listmaxshow < pluginlist.size()) + h_width += 15; - if(pluginlisttype == CPlugins::P_TYPE_GAME) - { - frameBuffer->paintIcon(NEUTRINO_ICON_GAMES,x+8,y+5); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+38,y+theight+1, width, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8 - } else if (pluginlisttype == CPlugins::P_TYPE_SCRIPT) - { - frameBuffer->paintIcon(NEUTRINO_ICON_SHELL,x+8,y+5); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+38,y+theight+1, width, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8 - } else - { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+8,y+theight+1, width, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8 - } + CComponentsHeader header(x, y, h_width, theight, name, NULL /* no header icon */); + + if (pluginlisttype == CPlugins::P_TYPE_GAME) + header.setIcon(NEUTRINO_ICON_GAMES); + else if (pluginlisttype == CPlugins::P_TYPE_SCRIPT) + header.setIcon(NEUTRINO_ICON_SHELL); + + header.paint(CC_SAVE_SCREEN_NO); } void CPluginList::paint() @@ -338,7 +334,7 @@ void CPluginList::paint() void CPluginList::paintItems() { - if(listmaxshow <= pluginlist.size()+1) + if(listmaxshow < pluginlist.size()) { // Scrollbar int nrOfPages = ((pluginlist.size()-1) / listmaxshow)+1;