mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
gui/components/cc_frm_clock.cpp: set CTextBox save screen and paint background flag;
add option to call first paint with save bg - default dont save; detach clock thread
This commit is contained in:
@@ -191,6 +191,9 @@ void CComponentsFrmClock::initCCLockItems()
|
||||
lbl->setColorAll(col_frame, col_body, col_shadow);
|
||||
lbl->setText(stmp, CTextBox::CENTER, *getClockFont());
|
||||
|
||||
lbl->doPaintTextBoxBg(paint_bg);
|
||||
lbl->enableTboxSaveScreen(save_tbox_screen);
|
||||
|
||||
//use matching height for digits for better vertical centerring into form
|
||||
CTextBox* ctb = lbl->getCTextBoxObject();
|
||||
if (ctb)
|
||||
@@ -285,6 +288,7 @@ bool CComponentsFrmClock::startThread()
|
||||
printf("[CComponentsFrmClock] [%s] pthread_create %s\n", __func__, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
pthread_detach(cl_thread);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -298,19 +302,20 @@ bool CComponentsFrmClock::stopThread()
|
||||
printf("[CComponentsFrmClock] [%s] pthread_cancel %s\n", __func__, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
#if 0
|
||||
res = pthread_join(cl_thread, NULL);
|
||||
if (res != 0){
|
||||
printf("[CComponentsFrmClock] [%s] pthread_join %s\n", __func__, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
hide();
|
||||
cl_thread = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CComponentsFrmClock::Start()
|
||||
bool CComponentsFrmClock::Start(bool do_save_bg)
|
||||
{
|
||||
if (!activeClock)
|
||||
return false;
|
||||
@@ -318,7 +323,7 @@ bool CComponentsFrmClock::Start()
|
||||
startThread();
|
||||
if (cl_thread) {
|
||||
//ensure paint of segements on first paint
|
||||
paint();
|
||||
paint(do_save_bg);
|
||||
paintClock = true;
|
||||
}
|
||||
return cl_thread == 0 ? false : true;
|
||||
|
Reference in New Issue
Block a user