diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index b244afa20..33c24f944 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1247,7 +1247,9 @@ void CMenuWidget::calcSize() if (neededWidth > width - frameBuffer->scale2Res(48)) { width = neededWidth + frameBuffer->scale2Res(48)+1; } - hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + + initHeader(); + hheight = header->getHeight(); int heightCurrPage=0; page_start.clear(); @@ -1354,9 +1356,12 @@ void CMenuWidget::paint() if (CInfoClock::getInstance()->isRun()) CInfoClock::getInstance()->disableInfoClock(); + calcSize(); + CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8 /*, nameString.c_str()*/); + /* prepare footer: * We must prepare footer, to get current footer dimensions, * otherwise footer will paint on wrong position @@ -1366,16 +1371,7 @@ void CMenuWidget::paint() OnBeforePaint(); // paint head - if (header == NULL){ - header = new CComponentsHeader(x, y, width + scrollbar_width, hheight, getName(), iconfile); - header->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT); - header->setOffset(OFFSET_INNER_MID); - } - header->setCaption(getName()); - header->setColorAll(COL_FRAME_PLUS_0, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0); - header->setCaptionColor(COL_MENUHEAD_TEXT); - header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); - header->enableGradientBgCleanUp(savescreen); + initHeader(); header->paint(CC_SAVE_SCREEN_NO); // paint body background @@ -1391,6 +1387,20 @@ void CMenuWidget::paint() footer->paint(CC_SAVE_SCREEN_NO); } +void CMenuWidget::initHeader() +{ + if (!header){ + header = new CComponentsHeader(x, y, width + scrollbar_width, 0, getName(), iconfile); + header->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT); + header->setOffset(OFFSET_INNER_MID); + } + header->setCaption(getName()); + header->setColorAll(COL_FRAME_PLUS_0, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0); + header->setCaptionColor(COL_MENUHEAD_TEXT); + header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); + header->enableGradientBgCleanUp(savescreen); +} + void CMenuWidget::setMenuPos(const int& menu_width) { int scr_x = frameBuffer->getScreenX(); diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index f501d35c2..11b70ab9c 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -608,6 +608,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals void saveScreen(); void restoreScreen(); void setMenuPos(const int& menu_width); + void initHeader(); public: CMenuWidget();