mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CComponentsFrmClock: set font only with fontrender object
This commit is contained in:
@@ -2079,10 +2079,11 @@ void CChannelList::paintHead()
|
||||
if (headerClock == NULL) {
|
||||
headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M");
|
||||
headerClock->setClockIntervall(10);
|
||||
headerClock->setClockFontType(SNeutrinoSettings::FONT_TYPE_MENU_TITLE);
|
||||
headerClock->setCornerRadius(RADIUS_LARGE);
|
||||
headerClock->setCornerType(CORNER_TOP_RIGHT);
|
||||
|
||||
}
|
||||
headerClock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]);
|
||||
headerClock->setCornerRadius(RADIUS_LARGE);
|
||||
headerClock->setCornerType(CORNER_TOP_RIGHT);
|
||||
headerClock->setYPos(y);
|
||||
headerClock->setHeight(theight);
|
||||
headerClock->setTextColor(COL_MENUHEAD);
|
||||
|
@@ -69,12 +69,10 @@ void CComponentsFrmClock::initVarClock()
|
||||
cc_item_type = CC_ITEMTYPE_FRM_CLOCK;
|
||||
corner_rad = RADIUS_SMALL;
|
||||
|
||||
cl_font_type = SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO;
|
||||
cl_font = NULL;
|
||||
cl_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO];
|
||||
cl_col_text = COL_MENUCONTENT;
|
||||
cl_format_str = "%H:%M";
|
||||
cl_align = CC_ALIGN_VER_CENTER | CC_ALIGN_HOR_CENTER;
|
||||
// cl_force_segment_paint = false;
|
||||
|
||||
cl_thread = 0;
|
||||
cl_interval = 1;
|
||||
@@ -112,8 +110,6 @@ void CComponentsFrmClock::initCCLockItems()
|
||||
initTimeString();
|
||||
string s_time = cl_timestr;
|
||||
|
||||
cl_font = g_Font[cl_font_type];
|
||||
|
||||
//get minimal required height, width from raw text
|
||||
int min_text_w = cl_font->getRenderWidth(s_time, true);;
|
||||
int min_text_h = cl_font->getHeight();
|
||||
|
@@ -57,12 +57,11 @@ class CComponentsFrmClock : public CComponentsForm
|
||||
///raw time chars
|
||||
char cl_timestr[20];
|
||||
|
||||
//TODO: please add comments!
|
||||
bool paintClock;
|
||||
bool activeClock;
|
||||
|
||||
///font
|
||||
int cl_font_type;
|
||||
///fontrenderer object
|
||||
///object: font render object
|
||||
Font *cl_font;
|
||||
///text color
|
||||
int cl_col_text;
|
||||
@@ -88,7 +87,7 @@ class CComponentsFrmClock : public CComponentsForm
|
||||
~CComponentsFrmClock();
|
||||
|
||||
///set font type for segments
|
||||
void setClockFontType(const int& font_type){cl_font_type = font_type;};
|
||||
void setClockFont(Font *font){cl_font = font;};
|
||||
|
||||
///set text color
|
||||
void setTextColor(fb_pixel_t color_text){ cl_col_text = color_text;};
|
||||
|
@@ -589,7 +589,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
else if (actionKey == "running_clock"){
|
||||
if (clock_r == NULL){
|
||||
clock_r = new CComponentsFrmClock(100, 50, 0, 50, "%H.%M:%S");
|
||||
clock_r->setClockFontType(SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME);
|
||||
clock_r->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]);
|
||||
clock_r->setClockIntervall(1);
|
||||
// clock_r->doPaintBg(false);
|
||||
}
|
||||
@@ -610,7 +610,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
else if (actionKey == "clock"){
|
||||
if (clock == NULL){
|
||||
clock = new CComponentsFrmClock(100, 50, 0, 50, "%H:%M", false);
|
||||
clock->setClockFontType(SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME);
|
||||
clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]);
|
||||
}
|
||||
|
||||
if (!clock->isPainted())
|
||||
|
Reference in New Issue
Block a user