From 6adaf26f480cdf26bb7e94797a1129a6e43274c0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 27 Apr 2018 15:57:27 +0200 Subject: [PATCH] src/gui/epgview.h: add class to create star bars --- src/gui/epgview.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 66a9c68ba..876fbd794 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -39,10 +39,12 @@ #include #include "widget/menue.h" #include "widget/navibar.h" +#include "gui/components/cc.h" #include #include class CFrameBuffer; +class CEPGRateBanner; class CEpgData { private: @@ -126,6 +128,39 @@ class CEPGDataHandler : public CMenuTarget }; +class CEPGRateBanner : public CComponentsIconForm +{ + private: + void init(const std::string& quote_icon, const std::string& quote_icon_bg, const size_t& quote, const size_t& quote_max, const std::string& provider_logo) + { + cc_item_type.name = "epg_rate_banner"; + append_x_offset = 5; + paint_bg = false; + addIcons(provider_logo); + addIcons(quote_icon, quote); + addIcons(quote_icon_bg, quote_max - quote); + } + + public: + + CEPGRateBanner( const int &x_pos, + const int &y_pos, + const size_t& quote, + const size_t& quote_max = 10, + const std::string& provider_logo = "", + const std::string& quote_icon = NEUTRINO_ICON_STAR_ON, + const std::string& quote_icon_bg = NEUTRINO_ICON_STAR_OFF, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, + CComponentsForm *parent = NULL) + :CComponentsIconForm(x_pos, y_pos, 0, 0, std::vector(), parent, shadow_mode, color_frame, color_body, color_shadow) + { + init(quote_icon, quote_icon_bg, quote, quote_max, provider_logo); + }; +}; + #endif