diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index eb1dad793..d52259a0a 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -137,12 +137,7 @@ void CBEBouquetWidget::paintItems() void CBEBouquetWidget::paintHead() { - header.setCaption(LOCALE_BOUQUETLIST_HEAD); - header.setIcon(NEUTRINO_ICON_SETTINGS); - header.setDimensionsAll(x, y, width, header_height); - header.setCorner(RADIUS_LARGE, CORNER_TOP); - header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); - header.paint(CC_SAVE_SCREEN_NO); + CBEGlobals::paintHead(g_Locale->getText(LOCALE_BOUQUETLIST_HEAD), NEUTRINO_ICON_SETTINGS); } const struct button_label CBEBouquetWidgetButtons[] = diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 1ef0c1c7d..f30904477 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -142,13 +142,8 @@ void CBEChannelWidget::paintItems() void CBEChannelWidget::paintHead() { - header.setCaption(caption + (mode == CZapitClient::MODE_TV ? " - TV" : " - Radio")); - header.setIcon(NULL); // trick the cc-header - header.setIcon(mode == CZapitClient::MODE_TV ? NEUTRINO_ICON_VIDEO : NEUTRINO_ICON_AUDIO); - header.setDimensionsAll(x, y, width, header_height); - header.setCorner(RADIUS_LARGE, CORNER_TOP); - header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); - header.paint(CC_SAVE_SCREEN_NO); + CBEGlobals::paintHead(caption + (mode == CZapitClient::MODE_TV ? " - TV" : " - Radio"), + mode == CZapitClient::MODE_TV ? NEUTRINO_ICON_VIDEO : NEUTRINO_ICON_AUDIO); } const struct button_label CBEChannelWidgetButtons[] = diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 9f58703e8..4ad6606f8 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -126,13 +126,8 @@ void CBEChannelSelectWidget::paintItems() void CBEChannelSelectWidget::paintHead() { - header.setCaption(caption + (mode == CZapitClient::MODE_TV ? " - TV" : " - Radio")); - header.setIcon(NULL); // trick the cc-header - header.setIcon(mode == CZapitClient::MODE_TV ? NEUTRINO_ICON_VIDEO : NEUTRINO_ICON_AUDIO); - header.setDimensionsAll(x, y, width, header_height); - header.setCorner(RADIUS_LARGE, CORNER_TOP); - header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); - header.paint(CC_SAVE_SCREEN_NO); + CBEGlobals::paintHead(caption + (mode == CZapitClient::MODE_TV ? " - TV" : " - Radio"), + mode == CZapitClient::MODE_TV ? NEUTRINO_ICON_VIDEO : NEUTRINO_ICON_AUDIO); } struct button_label CBEChannelSelectButtons[] = diff --git a/src/gui/bedit/bouqueteditor_globals.cpp b/src/gui/bedit/bouqueteditor_globals.cpp index 69dca3165..3df2c9dd7 100644 --- a/src/gui/bedit/bouqueteditor_globals.cpp +++ b/src/gui/bedit/bouqueteditor_globals.cpp @@ -135,3 +135,13 @@ void CBEGlobals::paintFoot(const size_t& label_count, const struct button_label footer.enableShadow(CC_SHADOW_ON, -1, true); footer.paintButtons(x, y + header_height + body_height, width, footer_height, label_count, content); } + +void CBEGlobals::paintHead(const std::string& Caption, const char* Icon) +{ + header.setCaption(Caption); + header.setIcon(Icon); + header.setDimensionsAll(x, y, width, header_height); + header.setCorner(RADIUS_LARGE, CORNER_TOP); + header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); + header.paint(CC_SAVE_SCREEN_NO); +} diff --git a/src/gui/bedit/bouqueteditor_globals.h b/src/gui/bedit/bouqueteditor_globals.h index 98aa263e4..6a3182873 100644 --- a/src/gui/bedit/bouqueteditor_globals.h +++ b/src/gui/bedit/bouqueteditor_globals.h @@ -56,6 +56,7 @@ class CBEGlobals unsigned int items_count; int* timeout_ptr; + void paintHead(const std::string& Caption, const char* Icon); void paintBody(); void paintFoot(const size_t& label_count, const struct button_label * const content);