wdget/navibar: remove nb_lpic->doPaintBg(false), code format changes

doPaintBg is no more required
This commit is contained in:
2021-11-13 18:56:46 +01:00
parent dbad675789
commit 288520b5b0
2 changed files with 47 additions and 45 deletions

View File

@@ -3,7 +3,7 @@
Copyright (C) 2001 by Steffen Hehn 'McClean' Copyright (C) 2001 by Steffen Hehn 'McClean'
Class for epg window navigation bar. Class for epg window navigation bar.
Copyright (C) 2017-2018, Thilo Graf 'dbt' Copyright (C) 2017-2021, Thilo Graf 'dbt'
License: GPL License: GPL
@@ -40,7 +40,10 @@ CNaviBar::CNaviBar( const int& x_pos,
fb_pixel_t &color_frame, fb_pixel_t &color_frame,
fb_pixel_t &color_body, fb_pixel_t &color_body,
fb_pixel_t &color_shadow) fb_pixel_t &color_shadow)
: CComponentsFrmChain( x_pos, y_pos, dx, dy, : CComponentsFrmChain( x_pos,
y_pos,
dx,
dy,
NULL, NULL,
CC_DIR_X, CC_DIR_X,
parent, parent,
@@ -68,27 +71,24 @@ void CNaviBar::initCCItems()
int mid_width = width * 40 / 100; // 40% int mid_width = width * 40 / 100; // 40%
int side_width = ((width - mid_width) / 2) - (2 * x_off); int side_width = ((width - mid_width) / 2) - (2 * x_off);
int h_text = height; int h_text = height;
int icon_h, icon_w;
// init left arrow // init left arrow
if (!nb_lpic){ if (!nb_lpic)
{
nb_lpic = new CComponentsPicture(x_off, CC_CENTERED, CFrameBuffer::getInstance()->getIconPath(NEUTRINO_ICON_BUTTON_LEFT)); nb_lpic = new CComponentsPicture(x_off, CC_CENTERED, CFrameBuffer::getInstance()->getIconPath(NEUTRINO_ICON_BUTTON_LEFT));
nb_lpic->getRealSize(&icon_h, &icon_w); if ((nb_lpic->getHeight() + 2 * OFFSET_INNER_MIN) > (height + 2 * OFFSET_INNER_MIN))
if ((icon_h + 2*OFFSET_INNER_MIN) > (height + 2*OFFSET_INNER_MIN)) nb_lpic->setHeight(height - 2 * OFFSET_INNER_MIN);
nb_lpic->setHeight(height - 2*OFFSET_INNER_MIN, true);
nb_lpic->doPaintBg(false);
this->addCCItem(nb_lpic); this->addCCItem(nb_lpic);
nb_lpic->enableSaveBg(); nb_lpic->enableSaveBg();
} }
nb_lpic->allowPaint(nb_lpic_enable); nb_lpic->allowPaint(nb_lpic_enable);
// init right arrow // init right arrow
if (!nb_rpic){ if (!nb_rpic)
{
nb_rpic = new CComponentsPicture(0, CC_CENTERED, CFrameBuffer::getInstance()->getIconPath(NEUTRINO_ICON_BUTTON_RIGHT)); nb_rpic = new CComponentsPicture(0, CC_CENTERED, CFrameBuffer::getInstance()->getIconPath(NEUTRINO_ICON_BUTTON_RIGHT));
nb_rpic->getRealSize(&icon_h, &icon_w); if ((nb_rpic->getHeight() + 2 * OFFSET_INNER_MIN) > (height + 2 * OFFSET_INNER_MIN))
if ((icon_h + 2*OFFSET_INNER_MIN) > (height + 2*OFFSET_INNER_MIN)) nb_rpic->setHeight(height - 2 * OFFSET_INNER_MIN);
nb_rpic->setHeight(height - 2*OFFSET_INNER_MIN, true);
nb_rpic->doPaintBg(false);
this->addCCItem(nb_rpic); this->addCCItem(nb_rpic);
nb_rpic->enableSaveBg(); nb_rpic->enableSaveBg();
int x_pos = width - nb_rpic->getWidth() - x_off; int x_pos = width - nb_rpic->getWidth() - x_off;
@@ -97,7 +97,8 @@ void CNaviBar::initCCItems()
nb_rpic->allowPaint(nb_rpic_enable); nb_rpic->allowPaint(nb_rpic_enable);
// init text left // init text left
if (!nb_lText){ if (!nb_lText)
{
nb_lText = new CComponentsText(x_off + nb_lpic->getWidth() + x_off, CC_CENTERED, side_width, h_text, "", CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, this, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); nb_lText = new CComponentsText(x_off + nb_lpic->getWidth() + x_off, CC_CENTERED, side_width, h_text, "", CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, this, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
nb_lText->doPaintBg(false); nb_lText->doPaintBg(false);
nb_lText->enableSaveBg(); nb_lText->enableSaveBg();
@@ -105,7 +106,8 @@ void CNaviBar::initCCItems()
nb_lText->setText(nb_l_text, CTextBox::NO_AUTO_LINEBREAK, nb_font, COL_MENUHEAD_TEXT, CComponentsText::FONT_STYLE_REGULAR); nb_lText->setText(nb_l_text, CTextBox::NO_AUTO_LINEBREAK, nb_font, COL_MENUHEAD_TEXT, CComponentsText::FONT_STYLE_REGULAR);
// init text right // init text right
if (!nb_rText){ if (!nb_rText)
{
nb_rText = new CComponentsText(0, CC_CENTERED, side_width, h_text, "", CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, this, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); nb_rText = new CComponentsText(0, CC_CENTERED, side_width, h_text, "", CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, this, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
nb_rText->doPaintBg(false); nb_rText->doPaintBg(false);
nb_rText->enableSaveBg(); nb_rText->enableSaveBg();

View File

@@ -3,7 +3,7 @@
Copyright (C) 2001 by Steffen Hehn 'McClean' Copyright (C) 2001 by Steffen Hehn 'McClean'
Class for epg window navigation bar. Class for epg window navigation bar.
Copyright (C) 2017, Thilo Graf 'dbt' Copyright (C) 2017, 2021, Thilo Graf 'dbt'
License: GPL License: GPL