bedit: remove multiple code from paintFoot() method

This commit is contained in:
2017-10-12 12:26:02 +02:00
parent b7124973de
commit 4dc047557f
5 changed files with 11 additions and 7 deletions

View File

@@ -159,9 +159,7 @@ void CBEBouquetWidget::paintFoot()
{ {
size_t numbuttons = sizeof(CBEBouquetWidgetButtons)/sizeof(CBEBouquetWidgetButtons[0]); size_t numbuttons = sizeof(CBEBouquetWidgetButtons)/sizeof(CBEBouquetWidgetButtons[0]);
footer.setCorner(RADIUS_LARGE, CORNER_BOTTOM); CBEGlobals::paintFoot(numbuttons, CBEBouquetWidgetButtons);
footer.enableShadow(CC_SHADOW_ON, -1, true);
footer.paintButtons(x, y + header_height + body_height, width, footer_height, numbuttons, CBEBouquetWidgetButtons);
} }
void CBEBouquetWidget::updateSelection(unsigned int newpos) void CBEBouquetWidget::updateSelection(unsigned int newpos)

View File

@@ -166,8 +166,7 @@ void CBEChannelWidget::paintFoot()
{ {
size_t numbuttons = sizeof(CBEChannelWidgetButtons)/sizeof(CBEChannelWidgetButtons[0]); size_t numbuttons = sizeof(CBEChannelWidgetButtons)/sizeof(CBEChannelWidgetButtons[0]);
footer.enableShadow(CC_SHADOW_ON, -1, true); CBEGlobals::paintFoot(numbuttons, CBEChannelWidgetButtons);
footer.paintButtons(x, y + header_height + body_height, width, footer_height, numbuttons, CBEChannelWidgetButtons);
} }
std::string CBEChannelWidget::getInfoText(int index) std::string CBEChannelWidget::getInfoText(int index)

View File

@@ -171,8 +171,7 @@ void CBEChannelSelectWidget::paintFoot()
const short numbuttons = sizeof(CBEChannelSelectButtons)/sizeof(CBEChannelSelectButtons[0]); const short numbuttons = sizeof(CBEChannelSelectButtons)/sizeof(CBEChannelSelectButtons[0]);
footer.enableShadow(CC_SHADOW_ON, -1, true); CBEGlobals::paintFoot(numbuttons, CBEChannelSelectButtons);
footer.paintButtons(x, y + header_height + body_height, width, footer_height, numbuttons, CBEChannelSelectButtons);
} }
std::string CBEChannelSelectWidget::getInfoText(int index) std::string CBEChannelSelectWidget::getInfoText(int index)

View File

@@ -128,3 +128,10 @@ void CBEGlobals::killDetails()
if (ibox) if (ibox)
ibox->kill(); ibox->kill();
} }
void CBEGlobals::paintFoot(const size_t& label_count, const struct button_label * const content)
{
footer.setCorner(RADIUS_LARGE, CORNER_BOTTOM);
footer.enableShadow(CC_SHADOW_ON, -1, true);
footer.paintButtons(x, y + header_height + body_height, width, footer_height, label_count, content);
}

View File

@@ -57,6 +57,7 @@ class CBEGlobals
int* timeout_ptr; int* timeout_ptr;
void paintBody(); void paintBody();
void paintFoot(const size_t& label_count, const struct button_label * const content);
virtual std::string getInfoText(int index) = 0; virtual std::string getInfoText(int index) = 0;
void paintDetails(int pos, int current); void paintDetails(int pos, int current);