mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
text screen save: try to rework screen save behavior for textbox objects
Screen save now always disabled by default and can be controlled
outside of relevant objects.
Origin commit data
------------------
Commit: 9d72b086a2
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-01-21 (Thu, 21 Jan 2016)
This commit is contained in:
@@ -2060,8 +2060,10 @@ void CChannelList::paint()
|
|||||||
|
|
||||||
void CChannelList::paintHead()
|
void CChannelList::paintHead()
|
||||||
{
|
{
|
||||||
if (header == NULL)
|
if (header == NULL){
|
||||||
header = new CComponentsHeader();
|
header = new CComponentsHeader();
|
||||||
|
header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use
|
||||||
|
}
|
||||||
|
|
||||||
header->setDimensionsAll(x, y, full_width, theight);
|
header->setDimensionsAll(x, y, full_width, theight);
|
||||||
|
|
||||||
@@ -2098,7 +2100,7 @@ void CChannelList::paintHead()
|
|||||||
else
|
else
|
||||||
logo_off = 10;
|
logo_off = 10;
|
||||||
|
|
||||||
header->paint(CC_SAVE_SCREEN_NO);
|
header->paint(CC_SAVE_SCREEN_NO); //TODO: paint title only, currently paint() does paint all enabled header items at once and causes flicker effects in unchanged items (e.g. clock)
|
||||||
}
|
}
|
||||||
|
|
||||||
CComponentsHeader* CChannelList::getHeaderObject()
|
CComponentsHeader* CChannelList::getHeaderObject()
|
||||||
|
@@ -174,6 +174,7 @@ void CComponentsButton::initCaption()
|
|||||||
if (cc_btn_capt_obj == NULL){
|
if (cc_btn_capt_obj == NULL){
|
||||||
cc_btn_capt_obj = new CComponentsLabel();
|
cc_btn_capt_obj = new CComponentsLabel();
|
||||||
cc_btn_capt_obj->doPaintBg(false);
|
cc_btn_capt_obj->doPaintBg(false);
|
||||||
|
cc_btn_capt_obj->doPaintTextBoxBg(false);
|
||||||
cc_btn_capt_obj->enableTboxSaveScreen(cc_txt_save_screen);
|
cc_btn_capt_obj->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
addCCItem(cc_btn_capt_obj);
|
addCCItem(cc_btn_capt_obj);
|
||||||
}
|
}
|
||||||
|
@@ -135,6 +135,27 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
|
|||||||
///set text color
|
///set text color
|
||||||
virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;}
|
virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;}
|
||||||
|
|
||||||
|
/**Member to modify background behavior of embeded caption object.
|
||||||
|
* @param[in] mode
|
||||||
|
* @li bool, default = true
|
||||||
|
* @return
|
||||||
|
* void
|
||||||
|
* @see
|
||||||
|
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||||
|
* CTextBox::enableSaveScreen()
|
||||||
|
* disableTboxSaveScreen()
|
||||||
|
*/
|
||||||
|
virtual void enableTboxSaveScreen(bool mode)
|
||||||
|
{
|
||||||
|
if (cc_txt_save_screen == mode)
|
||||||
|
return;
|
||||||
|
cc_txt_save_screen = mode;
|
||||||
|
for(size_t i=0; i<v_cc_items.size(); i++){
|
||||||
|
if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_LABEL)
|
||||||
|
static_cast<CComponentsLabel*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
///set caption: parameter as string
|
///set caption: parameter as string
|
||||||
virtual void setCaption(const std::string& text);
|
virtual void setCaption(const std::string& text);
|
||||||
///set caption: parameter as locale
|
///set caption: parameter as locale
|
||||||
|
@@ -402,16 +402,13 @@ void CComponentsFrmClock::kill(const fb_pixel_t& bg_color, bool ignore_parent)
|
|||||||
CComponentsForm::kill(bg_color, ignore_parent);
|
CComponentsForm::kill(bg_color, ignore_parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CComponentsFrmClock::enableSegmentSaveScreen(bool mode)
|
void CComponentsFrmClock::enableTboxSaveScreen(bool mode)
|
||||||
{
|
{
|
||||||
if (cc_txt_save_screen == mode || v_cc_items.empty())
|
if (cc_txt_save_screen == mode || v_cc_items.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cc_txt_save_screen = mode;
|
cc_txt_save_screen = mode;
|
||||||
|
|
||||||
for (size_t i = 0; i < v_cc_items.size(); i++){
|
for (size_t i = 0; i < v_cc_items.size(); i++){
|
||||||
CComponentsLabel *seg = static_cast <CComponentsLabel*>(v_cc_items[i]);
|
CComponentsLabel *seg = static_cast <CComponentsLabel*>(v_cc_items[i]);
|
||||||
//seg->clearSavedScreen();
|
|
||||||
seg->enableTboxSaveScreen(cc_txt_save_screen);
|
seg->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -158,8 +158,18 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen
|
|||||||
|
|
||||||
///reinitialize clock contents
|
///reinitialize clock contents
|
||||||
virtual void refresh() { initCCLockItems(); }
|
virtual void refresh() { initCCLockItems(); }
|
||||||
///allows to save bg screen behind text within segment objects, see also cl_save_segment_screen
|
|
||||||
void enableSegmentSaveScreen(bool mode);
|
/**Member to modify background behavior of embeded segment objects
|
||||||
|
* @param[in] mode
|
||||||
|
* @li bool, default = true
|
||||||
|
* @return
|
||||||
|
* void
|
||||||
|
* @see
|
||||||
|
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||||
|
* CTextBox::enableSaveScreen()
|
||||||
|
* disableTboxSaveScreen()
|
||||||
|
*/
|
||||||
|
void enableTboxSaveScreen(bool mode);
|
||||||
|
|
||||||
///set color gradient on/off, returns true if gradient mode was changed
|
///set color gradient on/off, returns true if gradient mode was changed
|
||||||
virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/);
|
virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/);
|
||||||
|
@@ -104,7 +104,8 @@ void CComponentsExtTextForm::initLabel()
|
|||||||
//initialize label object
|
//initialize label object
|
||||||
if (ccx_label_obj == NULL){
|
if (ccx_label_obj == NULL){
|
||||||
ccx_label_obj = new CComponentsLabel();
|
ccx_label_obj = new CComponentsLabel();
|
||||||
ccx_label_obj->doPaintBg(false);
|
ccx_label_obj->doPaintBg(!cc_txt_save_screen);
|
||||||
|
ccx_label_obj->doPaintTextBoxBg(false);
|
||||||
ccx_label_obj->enableTboxSaveScreen(cc_txt_save_screen);
|
ccx_label_obj->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +118,7 @@ void CComponentsExtTextForm::initLabel()
|
|||||||
ccx_label_width = (ccx_percent_label_w * width/100);
|
ccx_label_width = (ccx_percent_label_w * width/100);
|
||||||
ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font);
|
ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font);
|
||||||
ccx_label_obj->setTextColor(ccx_label_color);
|
ccx_label_obj->setTextColor(ccx_label_color);
|
||||||
ccx_label_obj->setDimensionsAll(fr_thickness, 0, ccx_label_width-fr_thickness, height-2*fr_thickness);
|
ccx_label_obj->setDimensionsAll(0, 0, ccx_label_width-2*fr_thickness, height-2*fr_thickness);
|
||||||
ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT);
|
ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,7 +128,8 @@ void CComponentsExtTextForm::initText()
|
|||||||
//initialize text object
|
//initialize text object
|
||||||
if (ccx_text_obj == NULL){
|
if (ccx_text_obj == NULL){
|
||||||
ccx_text_obj = new CComponentsText();
|
ccx_text_obj = new CComponentsText();
|
||||||
ccx_text_obj->doPaintBg(false);
|
ccx_text_obj->doPaintBg(!cc_txt_save_screen);
|
||||||
|
ccx_text_obj->doPaintTextBoxBg(false);
|
||||||
ccx_text_obj->enableTboxSaveScreen(cc_txt_save_screen);
|
ccx_text_obj->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -110,6 +110,24 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen
|
|||||||
///returns a pointer to the internal text object, use this to get access to its most properties
|
///returns a pointer to the internal text object, use this to get access to its most properties
|
||||||
CComponentsText*getTextObject(){return ccx_text_obj;};
|
CComponentsText*getTextObject(){return ccx_text_obj;};
|
||||||
|
|
||||||
|
/**Member to modify background behavior of embeded label and text objects
|
||||||
|
* @param[in] mode
|
||||||
|
* @li bool, default = true
|
||||||
|
* @return
|
||||||
|
* void
|
||||||
|
* @see
|
||||||
|
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||||
|
* CTextBox::enableSaveScreen()
|
||||||
|
* disableTboxSaveScreen()
|
||||||
|
*/
|
||||||
|
void enableTboxSaveScreen(bool mode){
|
||||||
|
if (cc_txt_save_screen == mode)
|
||||||
|
return;
|
||||||
|
cc_txt_save_screen = mode;
|
||||||
|
for(size_t i=0; i<v_cc_items.size(); i++)
|
||||||
|
static_cast<CComponentsText*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
|
};
|
||||||
|
|
||||||
///sets the text modes (mainly text alignment) to the label and text object, see /gui/widget/textbox.h for possible modes
|
///sets the text modes (mainly text alignment) to the label and text object, see /gui/widget/textbox.h for possible modes
|
||||||
void setTextModes(const int& label_mode, const int& text_mode);
|
void setTextModes(const int& label_mode, const int& text_mode);
|
||||||
|
|
||||||
|
@@ -86,7 +86,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
|
|||||||
fb_pixel_t color_shadow)
|
fb_pixel_t color_shadow)
|
||||||
{
|
{
|
||||||
cc_item_type = CC_ITEMTYPE_FRM_HEADER;
|
cc_item_type = CC_ITEMTYPE_FRM_HEADER;
|
||||||
cc_txt_save_screen = true;
|
cc_txt_save_screen = false;
|
||||||
x = x_old = x_pos;
|
x = x_old = x_pos;
|
||||||
y = y_old = y_pos;
|
y = y_old = y_pos;
|
||||||
|
|
||||||
|
@@ -211,6 +211,23 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
|
|||||||
///returns the text object
|
///returns the text object
|
||||||
virtual CComponentsText* getTextObject(){return cch_text_obj;}
|
virtual CComponentsText* getTextObject(){return cch_text_obj;}
|
||||||
|
|
||||||
|
/**Member to modify background behavior of embeded title
|
||||||
|
* @param[in] mode
|
||||||
|
* @li bool, default = true
|
||||||
|
* @return
|
||||||
|
* void
|
||||||
|
* @see
|
||||||
|
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||||
|
* CTextBox::enableSaveScreen()
|
||||||
|
* disableTboxSaveScreen()
|
||||||
|
*/
|
||||||
|
void enableTboxSaveScreen(bool mode)
|
||||||
|
{
|
||||||
|
cc_txt_save_screen = mode;
|
||||||
|
if (cch_text_obj->getCTextBoxObject())
|
||||||
|
cch_text_obj->getCTextBoxObject()->enableSaveScreen(cc_txt_save_screen);
|
||||||
|
}
|
||||||
|
|
||||||
///returns the clock object
|
///returns the clock object
|
||||||
virtual CComponentsFrmClock* getClockObject(){return cch_cl_obj;}
|
virtual CComponentsFrmClock* getClockObject(){return cch_cl_obj;}
|
||||||
|
|
||||||
|
@@ -106,7 +106,7 @@ void CSignalBar::initVarSigBar()
|
|||||||
append_x_offset = 2;
|
append_x_offset = 2;
|
||||||
append_y_offset = 2;
|
append_y_offset = 2;
|
||||||
height = SB_MIN_HEIGHT;
|
height = SB_MIN_HEIGHT;
|
||||||
|
cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR;
|
||||||
sb_scale_height = -1;
|
sb_scale_height = -1;
|
||||||
dy_font = CNeutrinoFonts::getInstance();
|
dy_font = CNeutrinoFonts::getInstance();
|
||||||
|
|
||||||
@@ -144,12 +144,13 @@ void CSignalBar::initSBarValue()
|
|||||||
//create value label object with basic properties
|
//create value label object with basic properties
|
||||||
if (sb_vlbl == NULL){
|
if (sb_vlbl == NULL){
|
||||||
sb_vlbl = new CComponentsLabel();
|
sb_vlbl = new CComponentsLabel();
|
||||||
sb_vlbl->doPaintBg(false);
|
|
||||||
sb_vlbl->doPaintTextBoxBg(false);
|
|
||||||
sb_vlbl->enableTboxSaveScreen(true);
|
|
||||||
sb_vlbl->setText(REF_PERCENT_TXT, sb_val_mode, sb_font);
|
sb_vlbl->setText(REF_PERCENT_TXT, sb_val_mode, sb_font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sb_vlbl->doPaintBg(false);
|
||||||
|
sb_vlbl->doPaintTextBoxBg(!cc_txt_save_screen);
|
||||||
|
sb_vlbl->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
|
|
||||||
//move and set dimensions
|
//move and set dimensions
|
||||||
int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_y_offset;
|
int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_y_offset;
|
||||||
int vlbl_h = sb_scale->getHeight();
|
int vlbl_h = sb_scale->getHeight();
|
||||||
@@ -169,12 +170,14 @@ void CSignalBar::initSBarName()
|
|||||||
//create name label object with basic properties
|
//create name label object with basic properties
|
||||||
if (sb_lbl == NULL){
|
if (sb_lbl == NULL){
|
||||||
sb_lbl = new CComponentsLabel();
|
sb_lbl = new CComponentsLabel();
|
||||||
sb_lbl->doPaintBg(false);
|
|
||||||
sb_lbl->doPaintTextBoxBg(false);
|
|
||||||
sb_lbl->enableTboxSaveScreen(true);
|
|
||||||
sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sb_lbl->doPaintBg(false);
|
||||||
|
sb_lbl->doPaintTextBoxBg(!cc_txt_save_screen);
|
||||||
|
sb_lbl->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
|
|
||||||
|
sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font);
|
||||||
|
|
||||||
//move and set dimensions
|
//move and set dimensions
|
||||||
int lbl_x = sb_vlbl->getXPos()+ sb_vlbl->getWidth();
|
int lbl_x = sb_vlbl->getXPos()+ sb_vlbl->getWidth();
|
||||||
int lbl_h = sb_vlbl->getHeight();
|
int lbl_h = sb_vlbl->getHeight();
|
||||||
@@ -316,11 +319,13 @@ void CSignalBox::initSignalItems()
|
|||||||
sbar->setFrontEnd(sbx_frontend);
|
sbar->setFrontEnd(sbx_frontend);
|
||||||
sbar->setCorner(0);
|
sbar->setCorner(0);
|
||||||
sbar->setScaleHeight(scale_h);
|
sbar->setScaleHeight(scale_h);
|
||||||
|
sbar->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
|
|
||||||
snrbar->setDimensionsAll(vertical ? sbar_x : CC_APPEND, vertical ? CC_APPEND : 1, sbar_w, sbar_h);
|
snrbar->setDimensionsAll(vertical ? sbar_x : CC_APPEND, vertical ? CC_APPEND : 1, sbar_w, sbar_h);
|
||||||
snrbar->setFrontEnd(sbx_frontend);
|
snrbar->setFrontEnd(sbx_frontend);
|
||||||
snrbar->setCorner(0);
|
snrbar->setCorner(0);
|
||||||
snrbar->setScaleHeight(scale_h);
|
snrbar->setScaleHeight(scale_h);
|
||||||
|
snrbar->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSignalBox::paintScale()
|
void CSignalBox::paintScale()
|
||||||
|
@@ -35,6 +35,7 @@
|
|||||||
#include <gui/components/cc_frm.h>
|
#include <gui/components/cc_frm.h>
|
||||||
#include <gui/components/cc_item_progressbar.h>
|
#include <gui/components/cc_item_progressbar.h>
|
||||||
#include <gui/components/cc_item_text.h>
|
#include <gui/components/cc_item_text.h>
|
||||||
|
#include <gui/components/cc_text_screen.h>
|
||||||
#include <zapit/include/zapit/frontend_c.h>
|
#include <zapit/include/zapit/frontend_c.h>
|
||||||
#include <driver/neutrinofonts.h>
|
#include <driver/neutrinofonts.h>
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ CSignalBar() and their sub classes based up CComponentsForm() and are usable lik
|
|||||||
CSignalBar() is intended to show signal rate.
|
CSignalBar() is intended to show signal rate.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CSignalBar : public CComponentsForm
|
class CSignalBar : public CComponentsForm, public CCTextScreen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///refresh current item properties, use this before paintScale().
|
///refresh current item properties, use this before paintScale().
|
||||||
@@ -141,6 +142,27 @@ class CSignalBar : public CComponentsForm
|
|||||||
|
|
||||||
//returns the current signal value
|
//returns the current signal value
|
||||||
uint16_t getValue(void) { return sb_signal; }
|
uint16_t getValue(void) { return sb_signal; }
|
||||||
|
|
||||||
|
/**Member to modify background behavior of embeded caption objects (value, name)
|
||||||
|
* @param[in] mode
|
||||||
|
* @li bool, default = true
|
||||||
|
* @return
|
||||||
|
* void
|
||||||
|
* @see
|
||||||
|
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||||
|
* CTextBox::enableSaveScreen()
|
||||||
|
* disableTboxSaveScreen()
|
||||||
|
*/
|
||||||
|
void enableTboxSaveScreen(bool mode)
|
||||||
|
{
|
||||||
|
if (cc_txt_save_screen == mode)
|
||||||
|
return;
|
||||||
|
cc_txt_save_screen = mode;
|
||||||
|
for(size_t i=0; i<v_cc_items.size(); i++){
|
||||||
|
if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_LABEL)
|
||||||
|
static_cast<CComponentsLabel*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Sub class of CSignalBar()
|
/// Sub class of CSignalBar()
|
||||||
@@ -237,7 +259,7 @@ void CSampleClass::hide ()
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CSignalBox : public CComponentsForm
|
class CSignalBox : public CComponentsForm, public CCTextScreen
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
///object: current frontend
|
///object: current frontend
|
||||||
@@ -289,8 +311,27 @@ class CSignalBox : public CComponentsForm
|
|||||||
|
|
||||||
///return current snr value
|
///return current snr value
|
||||||
uint16_t getSNRValue(void) { return snrbar->getValue();}
|
uint16_t getSNRValue(void) { return snrbar->getValue();}
|
||||||
|
|
||||||
///return current snr value
|
/**Member to modify background behavior of embeded caption objects (value, name)
|
||||||
|
* @param[in] mode
|
||||||
|
* @li bool, default = true
|
||||||
|
* @return
|
||||||
|
* void
|
||||||
|
* @see
|
||||||
|
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||||
|
* CTextBox::enableSaveScreen()
|
||||||
|
* disableTboxSaveScreen()
|
||||||
|
*/
|
||||||
|
void enableTboxSaveScreen(bool mode)
|
||||||
|
{
|
||||||
|
if (cc_txt_save_screen == mode)
|
||||||
|
return;
|
||||||
|
cc_txt_save_screen = mode;
|
||||||
|
for(size_t i=0; i<v_cc_items.size(); i++){
|
||||||
|
if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_FRM_SIGNALBAR)
|
||||||
|
static_cast<CSignalBar*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
|
||||||
|
}
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -145,13 +145,13 @@ void CComponentsText::initCCText()
|
|||||||
ct_textbox->setTextMode(ct_text_mode);
|
ct_textbox->setTextMode(ct_text_mode);
|
||||||
ct_textbox->setWindowPos(this);
|
ct_textbox->setWindowPos(this);
|
||||||
ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder);
|
ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder);
|
||||||
ct_textbox->enableBackgroundPaint(ct_paint_textbg);
|
ct_textbox->enableBackgroundPaint(ct_paint_textbg && !cc_txt_save_screen);
|
||||||
ct_textbox->setBackGroundColor(col_body);
|
ct_textbox->setBackGroundColor(col_body);
|
||||||
ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type);
|
ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type);
|
||||||
ct_textbox->setTextColor(ct_col_text);
|
ct_textbox->setTextColor(ct_col_text);
|
||||||
ct_textbox->setWindowMaxDimensions(iWidth, iHeight);
|
ct_textbox->setWindowMaxDimensions(iWidth, iHeight);
|
||||||
ct_textbox->setWindowMinDimensions(iWidth, iHeight);
|
ct_textbox->setWindowMinDimensions(iWidth, iHeight);
|
||||||
ct_textbox->enableSaveScreen(cc_txt_save_screen);
|
ct_textbox->enableSaveScreen(cc_txt_save_screen && !ct_paint_textbg);
|
||||||
ct_textbox->enableUTF8(ct_utf8_encoded);
|
ct_textbox->enableUTF8(ct_utf8_encoded);
|
||||||
|
|
||||||
//observe behavior of parent form if available
|
//observe behavior of parent form if available
|
||||||
|
@@ -177,14 +177,22 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox
|
|||||||
|
|
||||||
///returns count of lines from a text box page
|
///returns count of lines from a text box page
|
||||||
virtual int getTextLinesAutoHeight(const int& textMaxHeight, const int& textWidth, const int& mode);
|
virtual int getTextLinesAutoHeight(const int& textMaxHeight, const int& textWidth, const int& mode);
|
||||||
///allows to save bg screen behind text within CTextBox object, see also cc_txt_save_screen
|
|
||||||
|
/**Member to modify background behavior of textbox object
|
||||||
|
* @param[in] mode
|
||||||
|
* @li bool, default = true
|
||||||
|
* @return
|
||||||
|
* void
|
||||||
|
* @see
|
||||||
|
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||||
|
* CTextBox::enableSaveScreen()
|
||||||
|
* disableTboxSaveScreen()
|
||||||
|
*/
|
||||||
void enableTboxSaveScreen(bool mode)
|
void enableTboxSaveScreen(bool mode)
|
||||||
{
|
{
|
||||||
if (cc_txt_save_screen == mode)
|
|
||||||
return;
|
|
||||||
cc_txt_save_screen = mode;
|
cc_txt_save_screen = mode;
|
||||||
if (ct_textbox)
|
if (ct_textbox)
|
||||||
ct_textbox->enableSaveScreen(mode);
|
ct_textbox->enableSaveScreen(cc_txt_save_screen);
|
||||||
}
|
}
|
||||||
///enable/disable utf8 encoding
|
///enable/disable utf8 encoding
|
||||||
void enableUTF8(bool enable = true){ct_utf8_encoded = enable;}
|
void enableUTF8(bool enable = true){ct_utf8_encoded = enable;}
|
||||||
|
@@ -24,7 +24,6 @@
|
|||||||
#ifndef __CC_TXT_SCREEN__
|
#ifndef __CC_TXT_SCREEN__
|
||||||
#define __CC_TXT_SCREEN__
|
#define __CC_TXT_SCREEN__
|
||||||
|
|
||||||
|
|
||||||
//! Sub class for CTextBox using CComponent classes.
|
//! Sub class for CTextBox using CComponent classes.
|
||||||
/*!
|
/*!
|
||||||
This class contains flags or helpers to control CTextBox screen and paint handling and mostly used by
|
This class contains flags or helpers to control CTextBox screen and paint handling and mostly used by
|
||||||
@@ -38,7 +37,25 @@ class CCTextScreen
|
|||||||
bool cc_txt_save_screen;
|
bool cc_txt_save_screen;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CCTextScreen(){cc_txt_save_screen = false;};
|
CCTextScreen(){cc_txt_save_screen = false;}
|
||||||
|
|
||||||
|
/**Abstract member to modify background behavior of embeded textbox object
|
||||||
|
* @param[in] mode
|
||||||
|
* @li bool, default = true, enables backround saving of textbox object. This causes painting of backround from saved screen instead simple backround (if enabled)
|
||||||
|
* This is usefull if text should be paint on transparent background or background with color gradient.
|
||||||
|
* @return
|
||||||
|
* void
|
||||||
|
* @see
|
||||||
|
* CTextBox::enableSaveScreen()
|
||||||
|
* disableTboxSaveScreen()
|
||||||
|
*/
|
||||||
|
virtual void enableTboxSaveScreen(bool mode) = 0;
|
||||||
|
|
||||||
|
/**member to disable background behavior of embeded textbox object.
|
||||||
|
* @see
|
||||||
|
* disableTboxSaveScreen()
|
||||||
|
*/
|
||||||
|
virtual void disableTboxSaveScreen(){enableTboxSaveScreen(false);}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -252,10 +252,10 @@ void CInfoViewer::initClock()
|
|||||||
|
|
||||||
InfoClock->getInstance()->disableInfoClock();
|
InfoClock->getInstance()->disableInfoClock();
|
||||||
clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0);
|
clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0);
|
||||||
clock->enableSegmentSaveScreen(gradient_top);
|
clock->doPaintBg(!gradient_top);
|
||||||
|
clock->enableTboxSaveScreen(gradient_top);
|
||||||
clock->setColorBody(COL_INFOBAR_PLUS_0);
|
clock->setColorBody(COL_INFOBAR_PLUS_0);
|
||||||
clock->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT);
|
clock->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT);
|
||||||
clock->doPaintBg(!gradient_top);
|
|
||||||
clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]);
|
clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]);
|
||||||
clock->setPos(BoxEndX - 10 - clock->getWidth(), ChanNameY);
|
clock->setPos(BoxEndX - 10 - clock->getWidth(), ChanNameY);
|
||||||
clock->setTextColor(COL_INFOBAR_TEXT);
|
clock->setTextColor(COL_INFOBAR_TEXT);
|
||||||
@@ -1523,7 +1523,9 @@ void CInfoViewer::showSNR ()
|
|||||||
int sigbox_offset = ChanWidth *10/100;
|
int sigbox_offset = ChanWidth *10/100;
|
||||||
sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q");
|
sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q");
|
||||||
sigbox->setTextColor(COL_INFOBAR_TEXT);
|
sigbox->setTextColor(COL_INFOBAR_TEXT);
|
||||||
|
sigbox->setColorBody(numbox->getColorBody());
|
||||||
sigbox->doPaintBg(false);
|
sigbox->doPaintBg(false);
|
||||||
|
sigbox->enableTboxSaveScreen(numbox->getColBodyGradientMode());
|
||||||
}
|
}
|
||||||
sigbox->paint(CC_SAVE_SCREEN_NO);
|
sigbox->paint(CC_SAVE_SCREEN_NO);
|
||||||
}
|
}
|
||||||
|
@@ -588,8 +588,8 @@ void CTextBox::refreshText(void)
|
|||||||
//save screen only if no paint of background required
|
//save screen only if no paint of background required
|
||||||
if (!m_nPaintBackground && m_SaveScreen) {
|
if (!m_nPaintBackground && m_SaveScreen) {
|
||||||
if (m_bgpixbuf == NULL){
|
if (m_bgpixbuf == NULL){
|
||||||
//TRACE("[CTextBox] %s save bg %d\r\n", __FUNCTION__, __LINE__);
|
|
||||||
if ((dx * dy) >0){
|
if ((dx * dy) >0){
|
||||||
|
// TRACE("[CTextBox] [%s - %d] save bg for use as transparent background [%s]\n", __func__, __LINE__, m_cText.c_str());
|
||||||
m_bgpixbuf= new fb_pixel_t[dx * dy];
|
m_bgpixbuf= new fb_pixel_t[dx * dy];
|
||||||
frameBuffer->SaveScreen(ax, ay, dx, dy, m_bgpixbuf);
|
frameBuffer->SaveScreen(ax, ay, dx, dy, m_bgpixbuf);
|
||||||
}
|
}
|
||||||
@@ -598,7 +598,7 @@ void CTextBox::refreshText(void)
|
|||||||
|
|
||||||
//Paint Text Background
|
//Paint Text Background
|
||||||
bool allow_paint_bg = (m_old_cText != m_cText || has_changed || m_has_scrolled);
|
bool allow_paint_bg = (m_old_cText != m_cText || has_changed || m_has_scrolled);
|
||||||
if (m_nPaintBackground){
|
if (m_nPaintBackground && !m_SaveScreen){
|
||||||
clearScreenBuffer();
|
clearScreenBuffer();
|
||||||
if (allow_paint_bg){
|
if (allow_paint_bg){
|
||||||
//TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__);
|
//TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__);
|
||||||
|
Reference in New Issue
Block a user