mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
Merge branch 'master' into pu/mp
This commit is contained in:
@@ -1680,35 +1680,16 @@ void CChannelList::paintAdditionals(int index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::showChannelLogo() //TODO: move into an own handler, eg. header, channel logo should be paint inside header object
|
void CChannelList::showChannelLogo()
|
||||||
{
|
{
|
||||||
if ((*chanlist).empty())
|
if ((*chanlist).empty())
|
||||||
return;
|
return;
|
||||||
if(g_settings.channellist_show_channellogo){
|
if(g_settings.channellist_show_channellogo){
|
||||||
int logo_w_max = full_width / 4;
|
header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName());
|
||||||
int logo_h_max = theight - 2*OFFSET_INNER_MIN;
|
header->getChannelLogoObject()->hide();
|
||||||
if (CChannelLogo) {
|
header->getChannelLogoObject()->clearSavedScreen();
|
||||||
if (headerNew)
|
header->getChannelLogoObject()->allowPaint(true);
|
||||||
CChannelLogo->clearSavedScreen();
|
header->getChannelLogoObject()->paint();
|
||||||
else
|
|
||||||
CChannelLogo->hide();
|
|
||||||
delete CChannelLogo;
|
|
||||||
}
|
|
||||||
CChannelLogo = new CComponentsChannelLogoScalable(0, 0, (*chanlist)[selected]->getName(), (*chanlist)[selected]->getChannelID());
|
|
||||||
|
|
||||||
if (CChannelLogo->hasLogo()){
|
|
||||||
CChannelLogo->setWidth(min(CChannelLogo->getWidth(), logo_w_max), true);
|
|
||||||
if (CChannelLogo->getHeight() > logo_h_max)
|
|
||||||
CChannelLogo->setHeight(logo_h_max, true);
|
|
||||||
CChannelLogo->setXPos(x + full_width - logo_off - CChannelLogo->getWidth());
|
|
||||||
CChannelLogo->setYPos(y + (theight - CChannelLogo->getHeight()) / 2);
|
|
||||||
CChannelLogo->paint();
|
|
||||||
} else {
|
|
||||||
CChannelLogo->hide();
|
|
||||||
delete CChannelLogo;
|
|
||||||
CChannelLogo = NULL;
|
|
||||||
}
|
|
||||||
headerNew = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2176,7 +2157,14 @@ void CChannelList::paintHead()
|
|||||||
else
|
else
|
||||||
logo_off = OFFSET_INNER_MID;
|
logo_off = OFFSET_INNER_MID;
|
||||||
|
|
||||||
|
if(g_settings.channellist_show_channellogo){
|
||||||
|
//ensure to have clean background
|
||||||
|
header->getChannelLogoObject()->hide();
|
||||||
|
header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName());
|
||||||
|
header->getChannelLogoObject()->allowPaint(false);
|
||||||
|
}
|
||||||
header->paint(CC_SAVE_SCREEN_NO);
|
header->paint(CC_SAVE_SCREEN_NO);
|
||||||
|
showChannelLogo();
|
||||||
}
|
}
|
||||||
|
|
||||||
CComponentsHeader* CChannelList::getHeaderObject()
|
CComponentsHeader* CChannelList::getHeaderObject()
|
||||||
|
@@ -123,9 +123,10 @@
|
|||||||
#define COL_FRAME COL_MENUCONTENT_PLUS_6
|
#define COL_FRAME COL_MENUCONTENT_PLUS_6
|
||||||
#define COL_FRAME_PLUS_0 COL_FRAME
|
#define COL_FRAME_PLUS_0 COL_FRAME
|
||||||
|
|
||||||
|
#define COL_SCROLLBAR COL_MENUCONTENT_PLUS_1
|
||||||
#define COL_SCROLLBAR_ACTIVE COL_MENUCONTENT_PLUS_3
|
#define COL_SCROLLBAR_ACTIVE COL_MENUCONTENT_PLUS_3
|
||||||
#define COL_SCROLLBAR_ACTIVE_PLUS_0 COL_SCROLLBAR_ACTIVE
|
#define COL_SCROLLBAR_ACTIVE_PLUS_0 COL_SCROLLBAR_ACTIVE
|
||||||
#define COL_SCROLLBAR_PASSIVE COL_MENUCONTENT_PLUS_1
|
#define COL_SCROLLBAR_PASSIVE COL_MENUCONTENT_PLUS_2
|
||||||
#define COL_SCROLLBAR_PASSIVE_PLUS_0 COL_SCROLLBAR_PASSIVE
|
#define COL_SCROLLBAR_PASSIVE_PLUS_0 COL_SCROLLBAR_PASSIVE
|
||||||
|
|
||||||
#define COL_PROGRESSBAR_ACTIVE COL_MENUCONTENT_PLUS_7
|
#define COL_PROGRESSBAR_ACTIVE COL_MENUCONTENT_PLUS_7
|
||||||
|
@@ -31,6 +31,9 @@
|
|||||||
#include "cc_frm_header.h"
|
#include "cc_frm_header.h"
|
||||||
#include <system/debug.h>
|
#include <system/debug.h>
|
||||||
#include <driver/fontrenderer.h>
|
#include <driver/fontrenderer.h>
|
||||||
|
#include <driver/pictureviewer/pictureviewer.h>
|
||||||
|
|
||||||
|
extern CPictureViewer * g_PicViewer;
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -91,8 +94,8 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
|
|||||||
cc_item_type = CC_ITEMTYPE_FRM_HEADER;
|
cc_item_type = CC_ITEMTYPE_FRM_HEADER;
|
||||||
clear();
|
clear();
|
||||||
cc_txt_save_screen = false;
|
cc_txt_save_screen = false;
|
||||||
x = x_old = x_pos;
|
x = cc_xr = x_old = x_pos;
|
||||||
y = y_old = y_pos;
|
y = cc_yr = y_old = y_pos;
|
||||||
|
|
||||||
//init header width
|
//init header width
|
||||||
width = width_old = w == 0 ? frameBuffer->getScreenWidth(true) : w;
|
width = width_old = w == 0 ? frameBuffer->getScreenWidth(true) : w;
|
||||||
@@ -121,6 +124,11 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
|
|||||||
cch_text_obj = NULL;
|
cch_text_obj = NULL;
|
||||||
cch_btn_obj = NULL;
|
cch_btn_obj = NULL;
|
||||||
cch_cl_obj = NULL;
|
cch_cl_obj = NULL;
|
||||||
|
cch_logo_obj = NULL;
|
||||||
|
cch_logo.Id = 0;
|
||||||
|
cch_logo.Name = "";
|
||||||
|
cch_logo.dy_max = -1;
|
||||||
|
cch_logo.Align = CC_LOGO_RIGHT;
|
||||||
cch_col_text = COL_MENUHEAD_TEXT;
|
cch_col_text = COL_MENUHEAD_TEXT;
|
||||||
cch_caption_align = CTextBox::NO_AUTO_LINEBREAK;
|
cch_caption_align = CTextBox::NO_AUTO_LINEBREAK;
|
||||||
cch_items_y = CC_CENTERED;
|
cch_items_y = CC_CENTERED;
|
||||||
@@ -264,6 +272,49 @@ void CComponentsHeader::initIcon()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CComponentsHeader::initLogo()
|
||||||
|
{
|
||||||
|
cch_logo.dy_max = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_SMALL : cch_logo.dy_max;
|
||||||
|
|
||||||
|
if(!cch_logo_obj)
|
||||||
|
cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - cch_logo.dy_max/2, cch_logo.Name, cch_logo.Id, this);
|
||||||
|
else
|
||||||
|
cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name);
|
||||||
|
|
||||||
|
if (cch_logo_obj->hasLogo()){
|
||||||
|
cch_logo_obj->setHeight(cch_logo.dy_max, true);
|
||||||
|
|
||||||
|
// set id of logo item depends of neighbor items
|
||||||
|
int logo_id = getCCItemId(cch_logo_obj);
|
||||||
|
int next_id = logo_id + 1;
|
||||||
|
int prev_id = logo_id - 1;
|
||||||
|
|
||||||
|
//right end
|
||||||
|
int x_logo_right = getCCItem(next_id) ? getCCItem(next_id)->getXPos() - cch_logo_obj->getWidth() : width - cch_logo_obj->getWidth()-OFFSET_INNER_MID;
|
||||||
|
//left end
|
||||||
|
int x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0;
|
||||||
|
|
||||||
|
//calculate available space
|
||||||
|
int logo_space = x_logo_right + cch_logo_obj->getWidth() - x_logo_left;
|
||||||
|
|
||||||
|
//reduce logo width if logo space too small
|
||||||
|
int w_logo = min(cch_logo_obj->getWidth(), logo_space);
|
||||||
|
cch_logo_obj->setWidth(w_logo, true);
|
||||||
|
|
||||||
|
//set final logo position
|
||||||
|
int x_logo = 0;
|
||||||
|
if (cch_logo.Align == CC_LOGO_RIGHT)
|
||||||
|
x_logo = x_logo_right;
|
||||||
|
if (cch_logo.Align == CC_LOGO_LEFT)
|
||||||
|
x_logo = x_logo_left;
|
||||||
|
if (cch_logo.Align == CC_LOGO_CENTER)
|
||||||
|
x_logo = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2;
|
||||||
|
|
||||||
|
cch_logo_obj->setXPos(x_logo);
|
||||||
|
cch_logo_obj->setYPos(height/2 - cch_logo_obj->getHeight()/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CComponentsHeader::addContextButton(const std::string& button_name)
|
void CComponentsHeader::addContextButton(const std::string& button_name)
|
||||||
{
|
{
|
||||||
v_cch_btn.push_back(button_name);
|
v_cch_btn.push_back(button_name);
|
||||||
@@ -505,6 +556,9 @@ void CComponentsHeader::initCaption()
|
|||||||
if (cch_caption_align == CTextBox::CENTER)
|
if (cch_caption_align == CTextBox::CENTER)
|
||||||
cch_text_x = CC_CENTERED;
|
cch_text_x = CC_CENTERED;
|
||||||
|
|
||||||
|
//recalc caption width
|
||||||
|
cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID);
|
||||||
|
|
||||||
//assign general properties
|
//assign general properties
|
||||||
cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height);
|
cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height);
|
||||||
cch_text_obj->setColorBody(col_body);
|
cch_text_obj->setColorBody(col_body);
|
||||||
@@ -548,6 +602,9 @@ void CComponentsHeader::initCCItems()
|
|||||||
|
|
||||||
//init text
|
//init text
|
||||||
initCaption();
|
initCaption();
|
||||||
|
|
||||||
|
//init logo
|
||||||
|
initLogo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CComponentsHeader::paint(bool do_save_bg)
|
void CComponentsHeader::paint(bool do_save_bg)
|
||||||
|
@@ -36,9 +36,29 @@
|
|||||||
/*!
|
/*!
|
||||||
CComponentsHeader provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows
|
CComponentsHeader provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CComponentsHeader : public CComponentsForm, public CCTextScreen
|
class CComponentsHeader : public CComponentsForm, public CCTextScreen
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
///logo position options
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CC_LOGO_RIGHT ,
|
||||||
|
CC_LOGO_LEFT ,
|
||||||
|
CC_LOGO_CENTER
|
||||||
|
}cc_logo_alignment_t;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
///required logo data type
|
||||||
|
typedef struct cch_logo_t
|
||||||
|
{
|
||||||
|
uint64_t Id;
|
||||||
|
std::string Name;
|
||||||
|
int32_t dx_max;
|
||||||
|
int32_t dy_max;
|
||||||
|
cc_logo_alignment_t Align;
|
||||||
|
} cch_logo_struct_t;
|
||||||
|
|
||||||
///member: init genaral variables, parameters for mostly used properties
|
///member: init genaral variables, parameters for mostly used properties
|
||||||
void initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h,
|
void initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h,
|
||||||
const std::string& caption,
|
const std::string& caption,
|
||||||
@@ -59,6 +79,11 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
|
|||||||
CComponentsIconForm * cch_btn_obj;
|
CComponentsIconForm * cch_btn_obj;
|
||||||
///object: clock object
|
///object: clock object
|
||||||
CComponentsFrmClock * cch_cl_obj;
|
CComponentsFrmClock * cch_cl_obj;
|
||||||
|
///object: logo object
|
||||||
|
CComponentsChannelLogoScalable * cch_logo_obj;
|
||||||
|
|
||||||
|
///attributes for logos
|
||||||
|
cch_logo_t cch_logo;
|
||||||
|
|
||||||
///property: caption text, see also setCaption()
|
///property: caption text, see also setCaption()
|
||||||
std::string cch_text;
|
std::string cch_text;
|
||||||
@@ -112,6 +137,9 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
|
|||||||
void initButtons();
|
void initButtons();
|
||||||
///sub: init clock object
|
///sub: init clock object
|
||||||
void initClock();
|
void initClock();
|
||||||
|
///sub: init logo object
|
||||||
|
void initLogo();
|
||||||
|
|
||||||
///int repaint slot
|
///int repaint slot
|
||||||
void initRepaintSlot();
|
void initRepaintSlot();
|
||||||
|
|
||||||
@@ -275,6 +303,30 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
|
|||||||
|
|
||||||
///set color gradient on/off, returns true if gradient mode was changed
|
///set color gradient on/off, returns true if gradient mode was changed
|
||||||
virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/, const int& direction = -1);
|
virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/, const int& direction = -1);
|
||||||
|
|
||||||
|
/**Methode to set channel logo into header body via id and/or channel name
|
||||||
|
* @param[in] channelId
|
||||||
|
* @li required channel id as uint64_t
|
||||||
|
* @param[in] channelIName
|
||||||
|
* @li required channel name as std::string
|
||||||
|
* @param[in] alignment
|
||||||
|
* @li optional alingment parameter as cc_logo_alignment_t (enum)\n
|
||||||
|
* Possible values are:\n
|
||||||
|
* CC_LOGO_RIGHT \n
|
||||||
|
* CC_LOGO_CENTER (default)\n
|
||||||
|
* CC_LOGO_RIGHT \n
|
||||||
|
* @param[in] dy
|
||||||
|
* @li optional logo height, default = -1 (auto)
|
||||||
|
*/
|
||||||
|
void setChannelLogo( const uint64_t& channelId,
|
||||||
|
const std::string& channelName,
|
||||||
|
cc_logo_alignment_t alignment = CC_LOGO_CENTER,
|
||||||
|
const int& dy = -1)
|
||||||
|
{cch_logo.Id = channelId; cch_logo.Name = channelName, cch_logo.Align = alignment, cch_logo.dy_max = dy; initCCItems();}
|
||||||
|
/**Methode to get channel logo object for direct access to its properties and methodes
|
||||||
|
* @return CComponentsChannelLogoScalable*
|
||||||
|
*/
|
||||||
|
CComponentsChannelLogoScalable* getChannelLogoObject(){return cch_logo_obj;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Sub class of CComponentsHeader.
|
//! Sub class of CComponentsHeader.
|
||||||
|
@@ -32,29 +32,39 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
/* base schema
|
/* base schema
|
||||||
x,y
|
|
||||||
+-----------------+
|
x,y width (w)
|
||||||
|+---------------+|
|
/(x_pos, y_pos) ^
|
||||||
||sb_up_obj ||
|
+---------------------+
|
||||||
|| ||
|
| +-----------------+ |
|
||||||
|+---------------+|
|
| | sb_up_obj (icon)| |/color_frame
|
||||||
|+---------------+|
|
| | /\ | |
|
||||||
||sb_segments_obj||
|
| +-----------------+ | |/color_shadow
|
||||||
||+-------------+||
|
| col_body | |
|
||||||
||| segment |||
|
| |
|
||||||
||| id 0 |||
|
| +-sb_segments_obj+ |
|
||||||
||| |||
|
| | | |
|
||||||
||+-------------+||
|
| | +---segment---+ | |
|
||||||
||| segment |||
|
| | | id 0 | | |
|
||||||
||| id 1 |||
|
| | | active | | |
|
||||||
||| |||
|
| | | color_select| | |
|
||||||
||+-------------+||
|
| | +-------------+ | |
|
||||||
|+---------------+|
|
| | append_y_offset | |
|
||||||
|+---------------+|
|
| | +---segment---+ | |
|
||||||
||sb_up_obj ||
|
| | | id 1 | | |
|
||||||
|| ||
|
| | | passive | | |
|
||||||
|+---------------+|
|
| | |color_passive| | |
|
||||||
+-----------------+
|
| | +-------------+ | |
|
||||||
|
| | (count = 2) | |
|
||||||
|
| | other segments | |
|
||||||
|
| | are possible | |
|
||||||
|
| +-----------------+ |
|
||||||
|
| |
|
||||||
|
| +-----------------+ |
|
||||||
|
| | sb_up_obj (icon)| |
|
||||||
|
| | \/ | |
|
||||||
|
| +-----------------+ |
|
||||||
|
+---------------------+-> height (h)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//sub class CComponentsScrollBar inherit from CComponentsFrmChain
|
//sub class CComponentsScrollBar inherit from CComponentsFrmChain
|
||||||
@@ -64,13 +74,15 @@ CComponentsScrollBar::CComponentsScrollBar( const int &x_pos, const int &y_pos,
|
|||||||
int shadow_mode,
|
int shadow_mode,
|
||||||
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,
|
||||||
|
fb_pixel_t color_select,
|
||||||
|
fb_pixel_t color_passive)
|
||||||
:CComponentsFrmChain(x_pos, y_pos, w, h, NULL, CC_DIR_Y, parent, shadow_mode, color_frame, color_body, color_shadow)
|
:CComponentsFrmChain(x_pos, y_pos, w, h, NULL, CC_DIR_Y, parent, shadow_mode, color_frame, color_body, color_shadow)
|
||||||
{
|
{
|
||||||
initVarSbForm(count);
|
initVarSbForm(count, color_select, color_passive);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CComponentsScrollBar::initVarSbForm(const int& count)
|
void CComponentsScrollBar::initVarSbForm(const int& count, const fb_pixel_t& color_select, const fb_pixel_t& color_passive)
|
||||||
{
|
{
|
||||||
cc_item_type = CC_ITEMTYPE_FRM_SCROLLBAR;
|
cc_item_type = CC_ITEMTYPE_FRM_SCROLLBAR;
|
||||||
fr_thickness = 0;
|
fr_thickness = 0;
|
||||||
@@ -90,6 +102,10 @@ void CComponentsScrollBar::initVarSbForm(const int& count)
|
|||||||
sb_segments_count = count;
|
sb_segments_count = count;
|
||||||
sb_mark_id = 0;
|
sb_mark_id = 0;
|
||||||
|
|
||||||
|
sb_visual_enable = false;
|
||||||
|
sb_segment_col_sel = color_select;
|
||||||
|
sb_segment_col = color_passive;
|
||||||
|
|
||||||
initCCItems();
|
initCCItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,6 +175,8 @@ void CComponentsScrollBar::initSegments()
|
|||||||
if (h_seg < 0)
|
if (h_seg < 0)
|
||||||
h_seg = 0;
|
h_seg = 0;
|
||||||
|
|
||||||
|
fb_pixel_t passive_col = sb_visual_enable ? sb_segment_col : col_body;
|
||||||
|
|
||||||
//create and add segments to segment container
|
//create and add segments to segment container
|
||||||
for(u_int8_t i=0; i<sb_segments_count; i++){
|
for(u_int8_t i=0; i<sb_segments_count; i++){
|
||||||
CComponentsShapeSquare *item = new CComponentsShapeSquare(0, y_seg, w_seg, h_seg, sb_segments_obj, false);
|
CComponentsShapeSquare *item = new CComponentsShapeSquare(0, y_seg, w_seg, h_seg, sb_segments_obj, false);
|
||||||
@@ -168,23 +186,38 @@ void CComponentsScrollBar::initSegments()
|
|||||||
|
|
||||||
//set color for marked id
|
//set color for marked id
|
||||||
if (sb_mark_id == id){
|
if (sb_mark_id == id){
|
||||||
item->setColorBody(COL_SCROLLBAR_ACTIVE);
|
item->setColorBody(sb_segment_col_sel);
|
||||||
#if 0
|
#if 0
|
||||||
item->enableColBodyGradient(CC_COLGRAD_COL_A_2_COL_B);
|
item->enableColBodyGradient(CC_COLGRAD_COL_A_2_COL_B);
|
||||||
item->setColBodyGradient(CColorGradient::gradientDark2Light2Dark, CFrameBuffer::gradientHorizontal);
|
item->setColBodyGradient(CColorGradient::gradientDark2Light2Dark, CFrameBuffer::gradientHorizontal);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
item->setColorBody(COL_SCROLLBAR_PASSIVE);
|
item->setColorBody(passive_col);
|
||||||
#if 0
|
#if 0
|
||||||
item->disableColBodyGradient();
|
item->disableColBodyGradient();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//set corner types
|
//set different corner types for segments with possible conditions
|
||||||
sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_TOP);
|
if (passive_col == col_body){
|
||||||
sb_segments_obj->back()->setCorner(RADIUS_MIN, CORNER_BOTTOM);
|
item->setCorner(RADIUS_MIN, CORNER_ALL);
|
||||||
|
continue;
|
||||||
|
}else if (sb_segments_count == 1){
|
||||||
|
item->setCorner(RADIUS_MIN, CORNER_ALL);
|
||||||
|
break;
|
||||||
|
}else if(i == 0){
|
||||||
|
item->setCorner(RADIUS_MIN, CORNER_TOP);
|
||||||
|
continue;
|
||||||
|
}else if(i == sb_segments_count - 1){
|
||||||
|
item->setCorner(RADIUS_MIN, CORNER_BOTTOM);
|
||||||
|
break;
|
||||||
|
}else if((i > 0 && i < sb_segments_count - 1)){
|
||||||
|
item->setCorner(RADIUS_MIN, CORNER_NONE);
|
||||||
|
}else{
|
||||||
|
item->setCorner(RADIUS_MIN, CORNER_NONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -197,9 +230,11 @@ void paintScrollBar( const int &x_pos,
|
|||||||
int shadow_mode,
|
int shadow_mode,
|
||||||
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,
|
||||||
|
fb_pixel_t color_select,
|
||||||
|
fb_pixel_t color_passive)
|
||||||
{
|
{
|
||||||
CComponentsScrollBar scrollbar(x_pos, y_pos, w, h, count, NULL, shadow_mode, color_frame, color_body, color_shadow);
|
CComponentsScrollBar scrollbar(x_pos, y_pos, w, h, count, NULL, shadow_mode, color_frame, color_body, color_shadow, color_select, color_passive);
|
||||||
scrollbar.setMarkID(current_num);
|
scrollbar.setMarkID(current_num);
|
||||||
scrollbar.paint0();
|
scrollbar.paint0();
|
||||||
}
|
}
|
||||||
|
@@ -42,6 +42,12 @@ class CComponentsScrollBar : public CComponentsFrmChain
|
|||||||
///names of navi icons
|
///names of navi icons
|
||||||
std::string sb_up_icon, sb_down_icon;
|
std::string sb_up_icon, sb_down_icon;
|
||||||
|
|
||||||
|
///visualize count mode
|
||||||
|
bool sb_visual_enable;
|
||||||
|
|
||||||
|
///segment colors
|
||||||
|
fb_pixel_t sb_segment_col, sb_segment_col_sel;
|
||||||
|
|
||||||
///count of segments
|
///count of segments
|
||||||
int sb_segments_count;
|
int sb_segments_count;
|
||||||
|
|
||||||
@@ -55,11 +61,11 @@ class CComponentsScrollBar : public CComponentsFrmChain
|
|||||||
|
|
||||||
///init segements
|
///init segements
|
||||||
void initSegments();
|
void initSegments();
|
||||||
|
|
||||||
///init all items
|
///init all items
|
||||||
void initCCItems();
|
void initCCItems();
|
||||||
|
|
||||||
void initVarSbForm( const int& count);
|
void initVarSbForm( const int& count, const fb_pixel_t& color_select, const fb_pixel_t& color_passive);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**Class constructor to generate individual scrollbar objects
|
/**Class constructor to generate individual scrollbar objects
|
||||||
@@ -73,9 +79,11 @@ class CComponentsScrollBar : public CComponentsFrmChain
|
|||||||
* usual paraemters:
|
* usual paraemters:
|
||||||
* @param[in] parent optional, exepts type pointer to a parent CComponentsForm object, default NULL
|
* @param[in] parent optional, exepts type pointer to a parent CComponentsForm object, default NULL
|
||||||
* @param[in] shadow_mode optional, exepts type int defined by shadow mode enums, default CC_SHADOW_OFF
|
* @param[in] shadow_mode optional, exepts type int defined by shadow mode enums, default CC_SHADOW_OFF
|
||||||
* @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0
|
* @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR
|
||||||
* @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0
|
* @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR
|
||||||
* @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0
|
* @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0
|
||||||
|
* @param[in] color_select optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE
|
||||||
|
* @param[in] color_passive optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE
|
||||||
*/
|
*/
|
||||||
CComponentsScrollBar( const int &x_pos,
|
CComponentsScrollBar( const int &x_pos,
|
||||||
const int &y_pos,
|
const int &y_pos,
|
||||||
@@ -84,9 +92,11 @@ class CComponentsScrollBar : public CComponentsFrmChain
|
|||||||
const int& count = 1,
|
const int& count = 1,
|
||||||
CComponentsForm *parent = NULL,
|
CComponentsForm *parent = NULL,
|
||||||
int shadow_mode = CC_SHADOW_OFF,
|
int shadow_mode = CC_SHADOW_OFF,
|
||||||
fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0,
|
fb_pixel_t color_frame = COL_SCROLLBAR,
|
||||||
fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0,
|
fb_pixel_t color_body = COL_SCROLLBAR,
|
||||||
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
|
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
|
||||||
|
fb_pixel_t color_select = COL_SCROLLBAR_ACTIVE,
|
||||||
|
fb_pixel_t color_passive = COL_SCROLLBAR_PASSIVE);
|
||||||
// ~CComponentsScrollBar(); //inherited from CComponentsForm
|
// ~CComponentsScrollBar(); //inherited from CComponentsForm
|
||||||
|
|
||||||
/**Set current page number
|
/**Set current page number
|
||||||
@@ -123,6 +133,16 @@ class CComponentsScrollBar : public CComponentsFrmChain
|
|||||||
* @see setSegmentCount()
|
* @see setSegmentCount()
|
||||||
*/
|
*/
|
||||||
int getSegmentCount(){return sb_segments_count;}
|
int getSegmentCount(){return sb_segments_count;}
|
||||||
|
|
||||||
|
/**Enable/disable vizualized count of possible scroll items
|
||||||
|
* @param[in] enable optional, exepts type bool.
|
||||||
|
* @note Default mode is disabled.
|
||||||
|
*/
|
||||||
|
void enableVisualize(bool enable = true){sb_visual_enable = enable;}
|
||||||
|
|
||||||
|
/**Disable vizualized count of possible scroll items
|
||||||
|
*/
|
||||||
|
void disableVisualize(){enableVisualize(false);}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**Small and easy to apply scrollbar paint methode without expilcit object declaration
|
/**Small and easy to apply scrollbar paint methode without expilcit object declaration
|
||||||
@@ -141,6 +161,8 @@ class CComponentsScrollBar : public CComponentsFrmChain
|
|||||||
* @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0
|
* @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0
|
||||||
* @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0
|
* @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0
|
||||||
* @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0
|
* @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0
|
||||||
|
* @param[in] color_select optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE
|
||||||
|
* @param[in] color_passive optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE
|
||||||
*/
|
*/
|
||||||
void paintScrollBar( const int &x_pos,
|
void paintScrollBar( const int &x_pos,
|
||||||
const int &y_pos,
|
const int &y_pos,
|
||||||
@@ -149,8 +171,10 @@ void paintScrollBar( const int &x_pos,
|
|||||||
const int& count,
|
const int& count,
|
||||||
const int& current_num,
|
const int& current_num,
|
||||||
int shadow_mode = CC_SHADOW_OFF,
|
int shadow_mode = CC_SHADOW_OFF,
|
||||||
fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0,
|
fb_pixel_t color_frame = COL_SCROLLBAR,
|
||||||
fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0,
|
fb_pixel_t color_body = COL_SCROLLBAR,
|
||||||
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
|
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
|
||||||
|
fb_pixel_t color_select = COL_SCROLLBAR_ACTIVE,
|
||||||
|
fb_pixel_t color_passive = COL_SCROLLBAR_PASSIVE);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -128,9 +128,9 @@ void CComponentsPicture::setPicture(const char* picture_name)
|
|||||||
|
|
||||||
void CComponentsPicture::setWidth(const int& w, bool keep_aspect)
|
void CComponentsPicture::setWidth(const int& w, bool keep_aspect)
|
||||||
{
|
{
|
||||||
CComponentsItem::setWidth(w);
|
|
||||||
if (w == width && keep_aspect == keep_dy_aspect)
|
if (w == width && keep_aspect == keep_dy_aspect)
|
||||||
return;
|
return;
|
||||||
|
CComponentsItem::setWidth(w);
|
||||||
need_init = true;
|
need_init = true;
|
||||||
do_scale = true;
|
do_scale = true;
|
||||||
keep_dy_aspect = keep_aspect;
|
keep_dy_aspect = keep_aspect;
|
||||||
@@ -139,9 +139,9 @@ void CComponentsPicture::setWidth(const int& w, bool keep_aspect)
|
|||||||
|
|
||||||
void CComponentsPicture::setHeight(const int& h, bool keep_aspect)
|
void CComponentsPicture::setHeight(const int& h, bool keep_aspect)
|
||||||
{
|
{
|
||||||
CComponentsItem::setHeight(h);
|
|
||||||
if (h == height && keep_aspect == keep_dx_aspect)
|
if (h == height && keep_aspect == keep_dx_aspect)
|
||||||
return;
|
return;
|
||||||
|
CComponentsItem::setHeight(h);
|
||||||
need_init = true;
|
need_init = true;
|
||||||
do_scale = true;
|
do_scale = true;
|
||||||
keep_dx_aspect = keep_aspect;
|
keep_dx_aspect = keep_aspect;
|
||||||
|
@@ -115,6 +115,12 @@ void EpgPlus::Header::paint(const char * Name)
|
|||||||
|
|
||||||
if (this->head)
|
if (this->head)
|
||||||
{
|
{
|
||||||
|
if (g_settings.channellist_show_channellogo)
|
||||||
|
{
|
||||||
|
// ensure to have clean background
|
||||||
|
this->head->getChannelLogoObject()->hide();
|
||||||
|
this->head->getChannelLogoObject()->allowPaint(false);
|
||||||
|
}
|
||||||
this->head->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight());
|
this->head->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight());
|
||||||
this->head->setCaption(caption, CTextBox::NO_AUTO_LINEBREAK);
|
this->head->setCaption(caption, CTextBox::NO_AUTO_LINEBREAK);
|
||||||
this->head->setContextButton(CComponentsHeader::CC_BTN_HELP);
|
this->head->setContextButton(CComponentsHeader::CC_BTN_HELP);
|
||||||
@@ -123,6 +129,24 @@ void EpgPlus::Header::paint(const char * Name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EpgPlus::Header::paintChannelLogo(const CZapitChannel * Channel)
|
||||||
|
{
|
||||||
|
if (!g_settings.channellist_show_channellogo)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (this->head)
|
||||||
|
{
|
||||||
|
this->head->getChannelLogoObject()->hide();
|
||||||
|
this->head->getChannelLogoObject()->clearSavedScreen();
|
||||||
|
if (Channel)
|
||||||
|
{
|
||||||
|
this->head->setChannelLogo(Channel->getChannelID(), Channel->getName());
|
||||||
|
}
|
||||||
|
this->head->getChannelLogoObject()->allowPaint(true);
|
||||||
|
this->head->getChannelLogoObject()->paint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int EpgPlus::Header::getUsedHeight()
|
int EpgPlus::Header::getUsedHeight()
|
||||||
{
|
{
|
||||||
return font->getHeight();
|
return font->getHeight();
|
||||||
@@ -368,7 +392,7 @@ int EpgPlus::ChannelEventEntry::getUsedHeight()
|
|||||||
Font *EpgPlus::ChannelEntry::font = NULL;
|
Font *EpgPlus::ChannelEntry::font = NULL;
|
||||||
int EpgPlus::ChannelEntry::separationLineThickness = 0;
|
int EpgPlus::ChannelEntry::separationLineThickness = 0;
|
||||||
|
|
||||||
EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth)
|
EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Header * pheader, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth)
|
||||||
{
|
{
|
||||||
this->channel = pchannel;
|
this->channel = pchannel;
|
||||||
|
|
||||||
@@ -383,6 +407,7 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex,
|
|||||||
this->index = pindex;
|
this->index = pindex;
|
||||||
|
|
||||||
this->frameBuffer = pframeBuffer;
|
this->frameBuffer = pframeBuffer;
|
||||||
|
this->header = pheader;
|
||||||
this->footer = pfooter;
|
this->footer = pfooter;
|
||||||
this->bouquetList = pbouquetList;
|
this->bouquetList = pbouquetList;
|
||||||
|
|
||||||
@@ -510,6 +535,8 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime)
|
|||||||
|
|
||||||
detailsLine->setDimensionsAll(xPos, yPosTop, yPosBottom, this->font->getHeight()/2, this->footer->getUsedHeight() - RADIUS_LARGE*2);
|
detailsLine->setDimensionsAll(xPos, yPosTop, yPosBottom, this->font->getHeight()/2, this->footer->getUsedHeight() - RADIUS_LARGE*2);
|
||||||
detailsLine->paint(false);
|
detailsLine->paint(false);
|
||||||
|
|
||||||
|
this->header->paintChannelLogo(this->channel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,7 +671,7 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
|
|||||||
|
|
||||||
CZapitChannel * channel = (*this->channelList)[i];
|
CZapitChannel * channel = (*this->channelList)[i];
|
||||||
|
|
||||||
ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->footer, this->bouquetList, this->channelsTableX, yPosChannelEntry, this->channelsTableWidth);
|
ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->header, this->footer, this->bouquetList, this->channelsTableX, yPosChannelEntry, this->channelsTableWidth);
|
||||||
//printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL));
|
//printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL));
|
||||||
CChannelEventList channelEventList;
|
CChannelEventList channelEventList;
|
||||||
CEitManager::getInstance()->getEventsServiceKey(channel->getEpgID(), channelEventList);
|
CEitManager::getInstance()->getEventsServiceKey(channel->getEpgID(), channelEventList);
|
||||||
|
@@ -84,6 +84,8 @@ class EpgPlus
|
|||||||
|
|
||||||
void paint(const char * Name = NULL);
|
void paint(const char * Name = NULL);
|
||||||
|
|
||||||
|
void paintChannelLogo(const CZapitChannel * Channel = NULL);
|
||||||
|
|
||||||
static int getUsedHeight();
|
static int getUsedHeight();
|
||||||
|
|
||||||
//// attributes
|
//// attributes
|
||||||
@@ -192,6 +194,7 @@ class EpgPlus
|
|||||||
ChannelEntry(const CZapitChannel* channel,
|
ChannelEntry(const CZapitChannel* channel,
|
||||||
int index,
|
int index,
|
||||||
CFrameBuffer* frameBuffer,
|
CFrameBuffer* frameBuffer,
|
||||||
|
Header* header,
|
||||||
Footer* footer,
|
Footer* footer,
|
||||||
CBouquetList* bouquetList,
|
CBouquetList* bouquetList,
|
||||||
int x,
|
int x,
|
||||||
@@ -216,6 +219,7 @@ class EpgPlus
|
|||||||
int index;
|
int index;
|
||||||
|
|
||||||
CFrameBuffer* frameBuffer;
|
CFrameBuffer* frameBuffer;
|
||||||
|
Header* header;
|
||||||
Footer* footer;
|
Footer* footer;
|
||||||
CBouquetList* bouquetList;
|
CBouquetList* bouquetList;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user