From 22673fc30f61d306a32b6cd578ce178c76bcf76c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 6 Mar 2015 13:35:34 +0300 Subject: [PATCH] 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 ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f50840ac963fd7be3c80ea449da8e5133d46ea04 Author: [CST] Focus Date: 2015-03-06 (Fri, 06 Mar 2015) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_clock.cpp | 11 ++++++++--- src/gui/components/cc_frm_clock.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 68955fbcb..1db2ac0da 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -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; diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index babb07e29..64e6a6365 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -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