mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 18:31:22 +02:00
Merge remote-tracking branch 'test/cst-next'
This commit is contained in:
@@ -60,6 +60,7 @@ CComponents::CComponents() : COSDFader(g_settings.theme.menu_Content_alpha)
|
||||
firstPaint = true;
|
||||
is_painted = false;
|
||||
paint_bg = true;
|
||||
save_tbox_screen = false;
|
||||
cc_allow_paint = true;
|
||||
frameBuffer = CFrameBuffer::getInstance();
|
||||
v_fbdata.clear();
|
||||
|
@@ -114,6 +114,7 @@ class CComponents : public CComponentsSignals, public COSDFader
|
||||
bool is_painted;
|
||||
///mode: true=activate rendering of basic elements (frame, shadow and body)
|
||||
bool paint_bg;
|
||||
bool save_tbox_screen;
|
||||
///mode: true=allows painting of item, see also allowPaint()
|
||||
bool cc_allow_paint;
|
||||
|
||||
@@ -245,6 +246,8 @@ class CComponents : public CComponentsSignals, public COSDFader
|
||||
virtual bool isPainted(){return is_painted;}
|
||||
///allows paint of elementary item parts (shadow, frame and body), similar as background, set it usually to false, if item used in a form
|
||||
virtual void doPaintBg(bool do_paint){paint_bg = do_paint;};
|
||||
// enable/disable CTextBox screen saving on paint
|
||||
virtual void enableTboxSaveScreen(bool enable){ save_tbox_screen = enable; };
|
||||
|
||||
///allow/disalows paint of item and its contents, but initialize of other properties are not touched
|
||||
///this can be understood as a counterpart to isPainted(), but before paint and value of is_painted is modified temporarily till next paint of item //TODO: is this sufficiently?
|
||||
|
@@ -167,6 +167,7 @@ void CComponentsButton::initCaption()
|
||||
if (cc_btn_capt_obj == NULL){
|
||||
cc_btn_capt_obj = new CComponentsLabel();
|
||||
cc_btn_capt_obj->doPaintBg(false);
|
||||
cc_btn_capt_obj->enableTboxSaveScreen(save_tbox_screen);
|
||||
addCCItem(cc_btn_capt_obj);
|
||||
}
|
||||
}else{
|
||||
|
@@ -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
|
||||
|
@@ -105,6 +105,7 @@ void CComponentsExtTextForm::initLabel()
|
||||
if (ccx_label_obj == NULL){
|
||||
ccx_label_obj = new CComponentsLabel();
|
||||
ccx_label_obj->doPaintBg(false);
|
||||
ccx_label_obj->enableTboxSaveScreen(save_tbox_screen);
|
||||
}
|
||||
|
||||
//add label object
|
||||
@@ -127,6 +128,7 @@ void CComponentsExtTextForm::initText()
|
||||
if (ccx_text_obj == NULL){
|
||||
ccx_text_obj = new CComponentsText();
|
||||
ccx_text_obj->doPaintBg(false);
|
||||
ccx_text_obj->enableTboxSaveScreen(save_tbox_screen);
|
||||
}
|
||||
|
||||
//add text object
|
||||
|
@@ -376,6 +376,7 @@ void CComponentsHeader::initCaption()
|
||||
cch_text_obj->forceTextPaint(); //here required
|
||||
cch_text_obj->setTextColor(cch_col_text);
|
||||
cch_text_obj->setColorBody(col_body);
|
||||
cch_text_obj->enableTboxSaveScreen(save_tbox_screen);
|
||||
|
||||
//corner of text item
|
||||
cch_text_obj->setCorner(corner_rad-fr_thickness, corner_type);
|
||||
|
@@ -143,6 +143,7 @@ void CComponentsInfoBox::paint(bool do_save_bg)
|
||||
cctext->doPaintTextBoxBg(ct_paint_textbg);
|
||||
cctext->doPaintBg(false);
|
||||
cctext->setTextColor(ct_col_text);
|
||||
cctext->enableTboxSaveScreen(save_tbox_screen);
|
||||
|
||||
//calculate vars for x-position and dimensions
|
||||
int tx = x_offset + x_text + pic_w;
|
||||
|
@@ -62,7 +62,7 @@ CComponentsText::CComponentsText( const int x_pos, const int y_pos, const int w,
|
||||
|
||||
CComponentsText::~CComponentsText()
|
||||
{
|
||||
hide();
|
||||
//hide();
|
||||
clearCCText();
|
||||
}
|
||||
|
||||
@@ -146,6 +146,7 @@ void CComponentsText::initCCText()
|
||||
ct_textbox->setTextColor(ct_col_text);
|
||||
ct_textbox->setWindowMaxDimensions(iWidth, iHeight);
|
||||
ct_textbox->setWindowMinDimensions(iWidth, iHeight);
|
||||
ct_textbox->enableSaveScreen(save_tbox_screen);
|
||||
|
||||
//observe behavior of parent form if available
|
||||
bool force_text_paint = ct_force_text_paint;
|
||||
|
@@ -155,6 +155,13 @@ class CComponentsText : public CComponentsItem, public CBox
|
||||
|
||||
///returns count of lines from a text box page
|
||||
virtual int getTextLinesAutoHeight(const int& textMaxHeight, const int& textWidth, const int& mode);
|
||||
// overload function from cc_base CComponents
|
||||
void enableTboxSaveScreen(bool mode)
|
||||
{
|
||||
save_tbox_screen = mode;
|
||||
if (ct_textbox)
|
||||
ct_textbox->enableSaveScreen(mode);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user