diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 239f54445..8eb37455d 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -1127,7 +1127,7 @@ int CTestMenu::showTestMenu() char rev[255]; sprintf(rev, "Test menu, System revision %d %s", system_rev, system_rev == 0 ? "WARNING - INVALID" : ""); CMenuWidget w_test(rev /*"Test menu"*/, NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU); - w_test.addIntroItems(); + w_test.addIntroItems("Subhead"); w_test.addItem(new CMenuForwarder("Shell Window Test", true, NULL, this, "shellwindow")); //hardware @@ -1156,6 +1156,18 @@ int CTestMenu::showTestMenu() //restart gui w_test.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_RESTART , true, NULL, CNeutrinoApp::getInstance(), "restart", CRCInput::RC_standby)); + w_test.addItem(GenericMenuSeparatorLine); + + w_test.addItem(new CMenuSeparator(CMenuSeparator::STRING, "String Separator")); + w_test.addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "String Line Separator")); + + w_test.addItem(new CMenuSeparator(CMenuSeparator::SUB_HEAD, "Sub Title")); + + w_test.addItem(new CMenuSeparator(CMenuSeparator::SUB_HEAD | CMenuSeparator::ALIGN_LEFT, "Sub Title L")); + w_test.addItem(new CMenuSeparator(CMenuSeparator::SUB_HEAD | CMenuSeparator::ALIGN_RIGHT, "Sub Title R")); + + + //footer buttons static const struct button_label footerButtons[2] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_COLORCHOOSER_RED }, diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index c3f2d3a5d..df9948691 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -2476,13 +2476,24 @@ int CMenuSeparator::paint(bool selected) height = getHeight(); CFrameBuffer * frameBuffer = CFrameBuffer::getInstance(); + if ((type & SUB_HEAD)) + { + item_color = COL_MENUHEAD_TEXT; + item_bgcolor = g_settings.theme.menu_Head_gradient ? COL_MENUCONTENT_PLUS_0 : COL_MENUHEAD_PLUS_0; + } + else + { + item_color = COL_MENUCONTENTINACTIVE_TEXT; + item_bgcolor = COL_MENUCONTENT_PLUS_0; + } + frameBuffer->paintBoxRel(x, y, dx, height, item_bgcolor); if ((type & LINE)) { int grad = g_settings.theme.menu_Separator_gradient_enable ? CC_COLGRAD_COL_DARK_LIGHT_DARK : CC_COLGRAD_OFF; paintBoxRel(x+OFFSET_INNER_MID, y+(height>>1), dx-2*OFFSET_INNER_MID, 1, COL_MENUCONTENT_PLUS_1, 0, CORNER_NONE, grad, COL_MENUCONTENT_PLUS_0, CFrameBuffer::gradientHorizontal, CColorGradient::light); } - if ((type & STRING)) + if ((type & STRING) | (type & SUB_HEAD)) { const char * l_name = getName(); @@ -2494,7 +2505,7 @@ int CMenuSeparator::paint(bool selected) /* if no alignment is specified, align centered */ if (type & ALIGN_LEFT) - name_start_x = x + (2*OFFSET_INNER_MID + iconwidth); + name_start_x = x + (!(type & SUB_HEAD) ? name_start_x : 2*OFFSET_INNER_MID + iconwidth); else if (type & ALIGN_RIGHT) name_start_x = x + dx - stringwidth - 2*OFFSET_INNER_MID; else /* ALIGN_CENTER */ @@ -2505,6 +2516,7 @@ int CMenuSeparator::paint(bool selected) paintItemCaption(selected); } } + return y+ height; } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 3fa18cd4c..4f1ef9416 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -230,7 +230,7 @@ class CMenuSeparator : public CMenuItem ALIGN_CENTER = 4, ALIGN_LEFT = 8, ALIGN_RIGHT = 16, - SUB_HEAD = 0 //32 deprecated and invalid, only here for compatibility //TODO: remove global + SUB_HEAD = 32 // description "SUB_HEAD" seems is misleading };