mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 01:41:12 +02:00
CComponents: add property to allow/disallow paint of items
This causes initialization of all properties, but
affects the behavior of item paint.
This can be understood as a counterpart to isPainted().
Origin commit data
------------------
Commit: 8ae491a994
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-11-08 (Fri, 08 Nov 2013)
This commit is contained in:
@@ -97,16 +97,19 @@ void CComponentsInfoBox::paintPicture()
|
||||
//exit if no image definied
|
||||
if (pic_name == "")
|
||||
return;
|
||||
|
||||
|
||||
//init pic object and set icon paint position
|
||||
pic = new CComponentsPicture(x+fr_thickness+x_offset, y+fr_thickness, 0, 0, "");
|
||||
|
||||
//define icon
|
||||
pic->setPicture(pic_name);
|
||||
|
||||
|
||||
//fit icon into infobox
|
||||
pic->setHeight(height-2*fr_thickness);
|
||||
pic->setColorBody(col_body);
|
||||
|
||||
//paint, but set visibility mode
|
||||
pic->allowPaint(cc_allow_paint);
|
||||
pic->paint(CC_SAVE_SCREEN_NO);
|
||||
}
|
||||
|
||||
@@ -119,7 +122,7 @@ void CComponentsInfoBox::paint(bool do_save_bg)
|
||||
//NOTE: real values are reqiured, if we paint this item within a form as embedded cc-item
|
||||
int x_text = (cc_parent ? cc_xr : x) + fr_thickness;
|
||||
int y_text = (cc_parent ? cc_yr : y) + fr_thickness;
|
||||
|
||||
|
||||
//set text to the left border if picture is not painted
|
||||
int pic_w = 0;
|
||||
if ((pic) && (pic->isPicPainted()))
|
||||
@@ -141,7 +144,9 @@ void CComponentsInfoBox::paint(bool do_save_bg)
|
||||
int tw = width - x_offset - pic_w - 2*fr_thickness;
|
||||
int th = height-2*fr_thickness;
|
||||
cctext->setDimensionsAll(tx, y_text, tw, th);
|
||||
|
||||
cctext->paint(CC_SAVE_SCREEN_NO);
|
||||
|
||||
//paint, but set visibility mode
|
||||
cctext->allowPaint(cc_allow_paint);
|
||||
cctext->paint(CC_SAVE_SCREEN_NO);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user