mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
components: rework classes
- outsourced some classes cc_item.cpp/h, cc_draw.cpp/h - added extra methodes for simple use of some basic components extra.cpp/h - rework clock handling: use timer class, reworked members for enable/disable clock with external timer events, tryed to fix some display issues related with infoclock and time osd clock in moviebrowser, channellist, menuus - reworked hide/kill handling, removed parameter for hide(), try to use cached backgrounds for other constallations, paint cache, image cache (all beta) - reworked shadow/frame handling, add shadow modes for left/right arrangement, TODO: repaint for existant instances required - reworked color gradient assignment (beta) ... Note: I had a data crash in my local git tree and i tryed to restore my historie, but most was lost. Therefore here the commit is large
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
#include "cc_detailsline.h"
|
||||
#include "cc_draw.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -61,6 +62,7 @@ void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top
|
||||
|
||||
//CComponentsDetailLine
|
||||
thickness = 4;
|
||||
cc_body_gradient_enable = false;
|
||||
}
|
||||
|
||||
CComponentsDetailLine::~CComponentsDetailLine()
|
||||
@@ -85,41 +87,50 @@ CComponentsDetailLine::~CComponentsDetailLine()
|
||||
//paint details line with current parameters
|
||||
void CComponentsDetailLine::paint(bool do_save_bg)
|
||||
{
|
||||
clearFbData();
|
||||
cc_save_bg = do_save_bg;
|
||||
|
||||
int y_mark_top = y-h_mark_top/2+thickness/2;
|
||||
int y_mark_down = y_down-h_mark_down/2+thickness/2;
|
||||
hide();
|
||||
if (hasChanges())
|
||||
clearFbData();
|
||||
|
||||
int sw = shadow_w;
|
||||
if (v_fbdata.empty()){
|
||||
|
||||
comp_fbdata_t fbdata[] =
|
||||
{
|
||||
/* vertical item mark | */
|
||||
{CC_FBDATA_TYPE_LINE, x+width-thickness-sw, y_mark_top, thickness, h_mark_top, col_body, 0, 0, NULL, NULL},
|
||||
{CC_FBDATA_TYPE_LINE, x+width-sw, y_mark_top+sw, sw, h_mark_top-sw, col_shadow, 0, 0, NULL, NULL},
|
||||
{CC_FBDATA_TYPE_LINE, x+width-thickness, y_mark_top+h_mark_top, thickness, sw, col_shadow, 0, 0, NULL, NULL},
|
||||
int y_mark_top = y-h_mark_top/2+thickness/2;
|
||||
int y_mark_down = y_down-h_mark_down/2+thickness/2;
|
||||
|
||||
/* horizontal item line - */
|
||||
{CC_FBDATA_TYPE_LINE, x, y, width-thickness-sw, thickness, col_body, 0, 0, NULL, NULL},
|
||||
{CC_FBDATA_TYPE_LINE, x+thickness, y+thickness, width-2*thickness-sw, sw, col_shadow, 0, 0, NULL, NULL},
|
||||
int sw = shadow_w;
|
||||
|
||||
/* vertical connect line [ */
|
||||
{CC_FBDATA_TYPE_LINE, x, y+thickness, thickness, y_down-y-thickness, col_body, 0, 0, NULL, NULL},
|
||||
{CC_FBDATA_TYPE_LINE, x+thickness, y+thickness+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, NULL, NULL},
|
||||
cc_fbdata_t fbdata[] =
|
||||
{
|
||||
/*buffered bg full width and height */
|
||||
{true, CC_FBDATA_TYPE_BGSCREEN, x, y_mark_top, width, y_mark_down-y_mark_top+h_mark_down, 0, 0, 0, 0, NULL, NULL, NULL, false},
|
||||
|
||||
/* horizontal info line - */
|
||||
{CC_FBDATA_TYPE_LINE, x, y_down, width-thickness-sw, thickness, col_body, 0, 0, NULL, NULL},
|
||||
{CC_FBDATA_TYPE_LINE, x+sw, y_down+thickness, width-thickness-2*sw, sw, col_shadow, 0, 0, NULL, NULL},
|
||||
/* 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-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},
|
||||
|
||||
/* vertical info mark | */
|
||||
{CC_FBDATA_TYPE_LINE, x+width-thickness-sw, y_mark_down, thickness, h_mark_down, col_body, 0, 0, NULL, NULL},
|
||||
{CC_FBDATA_TYPE_LINE, x+width-sw, y_mark_down+sw, sw, h_mark_down-sw, col_shadow, 0, 0, NULL, NULL},
|
||||
{CC_FBDATA_TYPE_LINE, x+width-thickness, y_mark_down+h_mark_down,thickness, sw, col_shadow, 0, 0, NULL, NULL},
|
||||
};
|
||||
/* horizontal item line - */
|
||||
{true, CC_FBDATA_TYPE_BOX, x, y, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
||||
{true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
||||
|
||||
for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++)
|
||||
v_fbdata.push_back(fbdata[i]);
|
||||
/* vertical connect line [ */
|
||||
{true, CC_FBDATA_TYPE_BOX, x, y+thickness, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
||||
{true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false},
|
||||
|
||||
/* horizontal info line - */
|
||||
{true, CC_FBDATA_TYPE_BOX, x, y_down, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false},
|
||||
{true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness, width-thickness-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-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},
|
||||
};
|
||||
|
||||
for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++)
|
||||
v_fbdata.push_back(fbdata[i]);
|
||||
}
|
||||
paintFbItems(do_save_bg);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user