From 4dc047557f6d43f2299229a9cb89e4135607e7c2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 12 Oct 2017 12:26:02 +0200 Subject: [PATCH] bedit: remove multiple code from paintFoot() method --- src/gui/bedit/bouqueteditor_bouquets.cpp | 4 +--- src/gui/bedit/bouqueteditor_channels.cpp | 3 +-- src/gui/bedit/bouqueteditor_chanselect.cpp | 3 +-- src/gui/bedit/bouqueteditor_globals.cpp | 7 +++++++ src/gui/bedit/bouqueteditor_globals.h | 1 + 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 2ecabefbc..eb1dad793 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -159,9 +159,7 @@ void CBEBouquetWidget::paintFoot() { size_t numbuttons = sizeof(CBEBouquetWidgetButtons)/sizeof(CBEBouquetWidgetButtons[0]); - footer.setCorner(RADIUS_LARGE, CORNER_BOTTOM); - footer.enableShadow(CC_SHADOW_ON, -1, true); - footer.paintButtons(x, y + header_height + body_height, width, footer_height, numbuttons, CBEBouquetWidgetButtons); + CBEGlobals::paintFoot(numbuttons, CBEBouquetWidgetButtons); } void CBEBouquetWidget::updateSelection(unsigned int newpos) diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 76a9b2022..1ef0c1c7d 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -166,8 +166,7 @@ void CBEChannelWidget::paintFoot() { size_t numbuttons = sizeof(CBEChannelWidgetButtons)/sizeof(CBEChannelWidgetButtons[0]); - footer.enableShadow(CC_SHADOW_ON, -1, true); - footer.paintButtons(x, y + header_height + body_height, width, footer_height, numbuttons, CBEChannelWidgetButtons); + CBEGlobals::paintFoot(numbuttons, CBEChannelWidgetButtons); } std::string CBEChannelWidget::getInfoText(int index) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 8b98500cc..9f58703e8 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -171,8 +171,7 @@ void CBEChannelSelectWidget::paintFoot() const short numbuttons = sizeof(CBEChannelSelectButtons)/sizeof(CBEChannelSelectButtons[0]); - footer.enableShadow(CC_SHADOW_ON, -1, true); - footer.paintButtons(x, y + header_height + body_height, width, footer_height, numbuttons, CBEChannelSelectButtons); + CBEGlobals::paintFoot(numbuttons, CBEChannelSelectButtons); } std::string CBEChannelSelectWidget::getInfoText(int index) diff --git a/src/gui/bedit/bouqueteditor_globals.cpp b/src/gui/bedit/bouqueteditor_globals.cpp index 445742c7c..69dca3165 100644 --- a/src/gui/bedit/bouqueteditor_globals.cpp +++ b/src/gui/bedit/bouqueteditor_globals.cpp @@ -128,3 +128,10 @@ void CBEGlobals::killDetails() if (ibox) 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); +} diff --git a/src/gui/bedit/bouqueteditor_globals.h b/src/gui/bedit/bouqueteditor_globals.h index 299e42ed1..98aa263e4 100644 --- a/src/gui/bedit/bouqueteditor_globals.h +++ b/src/gui/bedit/bouqueteditor_globals.h @@ -57,6 +57,7 @@ class CBEGlobals int* timeout_ptr; void paintBody(); + void paintFoot(const size_t& label_count, const struct button_label * const content); virtual std::string getInfoText(int index) = 0; void paintDetails(int pos, int current);