Merge branch 'ni/tuxbox' into ni/mp/tuxbox

Conflicts:
	src/gui/scan_setup.cpp
	src/zapit/src/frontend.cpp


Origin commit data
------------------
Commit: 55743aff0c
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-15 (Wed, 15 Mar 2017)
This commit is contained in:
vanhofen
2017-03-15 23:39:43 +01:00
42 changed files with 241 additions and 144 deletions

View File

@@ -35,15 +35,15 @@
using namespace std;
//sub class CComponentsDetailLine from CComponents
CComponentsDetailLine::CComponentsDetailLine( const int& x_pos, const int& y_pos_top,
//sub class CComponentsDetailsLine from CComponents
CComponentsDetailsLine::CComponentsDetailsLine( const int& x_pos, const int& y_pos_top,
const int& y_pos_down, const int& h_mark_top_, const int& h_mark_down_,
fb_pixel_t color_line, fb_pixel_t color_shadow)
{
initVarDline(x_pos, y_pos_top, y_pos_down, h_mark_top_, h_mark_down_, color_line, color_shadow);
}
void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top,
void CComponentsDetailsLine::initVarDline( const int& x_pos, const int& y_pos_top,
const int& y_pos_down, const int& h_mark_top_, const int& h_mark_down_,
fb_pixel_t color_line, fb_pixel_t color_shadow)
{
@@ -53,20 +53,20 @@ void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top
col_shadow = color_shadow;
col_body = color_line;
//CComponentsDetailLine
//CComponentsDetailsLine
y_down = y_pos_down;
h_mark_top = h_mark_top_;
h_mark_down = h_mark_down_;
shadow_w = 1;
//CComponentsDetailLine
thickness = 2; /* MUST be an even value! */ //NI
//CComponentsDetailsLine
dl_w = CFrameBuffer::getInstance()->scale2Res(2); //NI
cc_body_gradient_enable = false;
}
CComponentsDetailLine::~CComponentsDetailLine()
CComponentsDetailsLine::~CComponentsDetailsLine()
{
}
@@ -86,7 +86,7 @@ CComponentsDetailLine::~CComponentsDetailLine()
//paint details line with current parameters
void CComponentsDetailLine::paint(bool do_save_bg)
void CComponentsDetailsLine::paint(bool do_save_bg)
{
//NI
if (!g_settings.show_menu_hints_line) return;
@@ -104,6 +104,7 @@ void CComponentsDetailLine::paint(bool do_save_bg)
int y_mark_top = y-h_mark_top/2;
int y_mark_down = y_down-h_mark_down/2;
int dx_c = dl_w%2; //correction for odd values
cc_fbdata_t fbdata[] =
{
@@ -111,26 +112,26 @@ void CComponentsDetailLine::paint(bool do_save_bg)
{true, CC_FBDATA_TYPE_BGSCREEN, x, y_mark_top, width, y_mark_down-y_mark_top+h_mark_down+sw, 0, 0, 0, 0, NULL, NULL, NULL, false},
/* vertical item mark | */
{true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_top, thickness, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_top, dl_w, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_top+sw, sw, h_mark_top-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_top+h_mark_top, thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_top+h_mark_top, dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
/* horizontal item line - */
{true, CC_FBDATA_TYPE_BOX, x, y-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x, y-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, width-2*dl_w-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
/* vertical connect line [ */
{true, CC_FBDATA_TYPE_BOX, x, y+thickness/2, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x, y+dl_w/2+dx_c, dl_w, y_down-y-dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, sw, y_down-y-dl_w, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
/* horizontal info line - */
{true, CC_FBDATA_TYPE_BOX, x, y_down-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness/2, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x, y_down-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+sw, y_down+dl_w/2+dx_c, width-dl_w-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
/* vertical info mark | */
{true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_down, thickness, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_down, dl_w, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_down+sw, sw, h_mark_down-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_down+h_mark_down,thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
{true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_down+h_mark_down,dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
};
for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++)
@@ -142,7 +143,7 @@ void CComponentsDetailLine::paint(bool do_save_bg)
//synchronize colors for details line
//This is usefull if the system colors are changed during runtime
//so you can ensure correct applied system colors in relevant objects with unchanged instances.
void CComponentsDetailLine::syncSysColors()
void CComponentsDetailsLine::syncSysColors()
{
col_body = COL_FRAME_PLUS_0;
col_shadow = COL_SHADOW_PLUS_0;

View File

@@ -37,11 +37,11 @@
Not usable as CCItem!
*/
class CComponentsDetailLine : public CComponents
class CComponentsDetailsLine : public CComponents
{
private:
///property: line thickness
int thickness;
///property: line width
int dl_w;
///property: lowest y position
int y_down;
///property: height of top marker
@@ -55,10 +55,10 @@ class CComponentsDetailLine : public CComponents
fb_pixel_t color_line, fb_pixel_t color_shadow);
public:
CComponentsDetailLine( const int& x_pos = 1,const int& y_pos_top = 1, const int& y_pos_down = 1,
CComponentsDetailsLine( const int& x_pos = 1,const int& y_pos_top = 1, const int& y_pos_down = 1,
const int& h_mark_top_ = CC_HEIGHT_MIN , const int& h_mark_down_ = CC_HEIGHT_MIN,
fb_pixel_t color_line = COL_FRAME_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
~CComponentsDetailLine();
~CComponentsDetailsLine();
///set colors
void setColors(fb_pixel_t color_line, fb_pixel_t color_shadow){col_body = color_line; col_shadow = color_shadow;};
@@ -73,6 +73,8 @@ class CComponentsDetailLine : public CComponents
///set all positions and dimensions of details line at once
void setDimensionsAll(const int& x_pos,const int& y_pos, const int& y_pos_down, const int& h_mark_top_ , const int& h_mark_down_)
{setXPos(x_pos); setYPos(y_pos); setYPosDown(y_pos_down); setHMarkTop(h_mark_top_); setHMarkDown(h_mark_down_);}
///property: set line thickness
void setLineWidth(const int& w){dl_w = w;}
///paint all to screen
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);

View File

@@ -31,7 +31,8 @@
#include <driver/fontrenderer.h>
#define DEF_HEIGHT 27
#define DEF_HEIGHT CFrameBuffer::getInstance()->scale2Res(27)
#define DEF_WIDTH CFrameBuffer::getInstance()->scale2Res(300)
#define DEF_LABEL_WIDTH_PERCENT 30
using namespace std;
@@ -39,7 +40,7 @@ using namespace std;
CComponentsExtTextForm::CComponentsExtTextForm(CComponentsForm* parent)
{
Font* t_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO];
initVarExtTextForm(0, 0, 300, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0);
initVarExtTextForm(0, 0, DEF_WIDTH, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0);
initCCTextItems();
}
@@ -86,8 +87,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p
width = w;
//init ccx_label_width and ccx_text_width
//default ccx_label_width = 30% of form width
ccx_percent_label_w = DEF_LABEL_WIDTH_PERCENT;
ccx_label_width = ccx_percent_label_w * width/100;
ccx_label_width = DEF_LABEL_WIDTH_PERCENT * width/100;
ccx_text_width = width-ccx_label_width;
height = h;
@@ -223,7 +223,8 @@ void CComponentsExtTextForm::initCCTextItems()
void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val)
{
ccx_percent_label_w = (int)percent_val;
ccx_label_width = (int)percent_val * width/100;
ccx_text_width = width-ccx_label_width;
initCCTextItems();
}

View File

@@ -49,8 +49,6 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen
int ccx_text_width;
///property: font type of both items (label and text), see also setLabelAndText()
Font* ccx_font;
///property: percentage val of label width related to full width, causes fit of text automatically into the available remaining size of item, see also setLabelWidthPercent()
uint8_t ccx_percent_label_w;
///centered y position of label and text
int y_text;

View File

@@ -29,18 +29,6 @@
#include <global.h>
#include <gui/widget/buttons.h> //for compatibility with 'button_label' type
//for 'button_label' type with string
typedef struct button_label_cc
{
const char * button;
std::string text;
neutrino_locale_t locale;
neutrino_msg_t directKey;
neutrino_msg_t directKeyAlt;
int btn_result;
int btn_alias;
button_label_cc(): text(std::string()), locale(NONEXISTANT_LOCALE){}
} button_label_cc_struct;
/*!
CComponentsFooter, sub class of CComponentsHeader provides prepared container for footer

View File

@@ -175,8 +175,24 @@ typedef struct cc_string_ext_txt_t
Font* font;
} cc_string_ext_txt_struct_t;
#define CC_WIDTH_MIN 16
#define CC_HEIGHT_MIN 16
//for 'button_label' type with string
typedef struct button_label_cc
{
const char * button;
std::string text;
neutrino_locale_t locale;
neutrino_msg_t directKey;
neutrino_msg_t directKeyAlt;
int btn_result;
int btn_alias;
std::string bg_image;
std::string hint;
button_label_cc(): button(NULL), text(std::string()), locale(NONEXISTANT_LOCALE){}
} button_label_cc_struct;
#define CC_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(16)
#define CC_HEIGHT_MIN CC_WIDTH_MIN
#define CC_SHADOW_OFF 0x0
#define CC_SHADOW_RIGHT 0x2