mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +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
Origin commit data
------------------
Commit: f50840ac96
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2015-03-06 (Fri, 06 Mar 2015)
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;
|
||||
|
@@ -126,7 +126,7 @@ class CComponentsFrmClock : public CComponentsForm
|
||||
///stop ticking clock thread, returns true on success, if false causes log output
|
||||
virtual bool stopThread();
|
||||
|
||||
virtual bool Start();
|
||||
virtual bool Start(bool do_save_bg = CC_SAVE_SCREEN_NO);
|
||||
virtual bool Stop();
|
||||
|
||||
///returns true, if clock is running in thread
|
||||
|
Reference in New Issue
Block a user