mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CCDraw: add parameter force_paint to member enableShadow()
TODO executed Default behavior is not changed but parameter allows repaint shadow in some constellations if required.
This commit is contained in:
@@ -50,6 +50,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha)
|
|||||||
|
|
||||||
shadow = CC_SHADOW_OFF;
|
shadow = CC_SHADOW_OFF;
|
||||||
shadow_w = shadow_w_old = SHADOW_OFFSET;
|
shadow_w = shadow_w_old = SHADOW_OFFSET;
|
||||||
|
shadow_force = false;
|
||||||
|
|
||||||
cc_paint_cache = false;
|
cc_paint_cache = false;
|
||||||
cc_scrdata.pixbuf = NULL;
|
cc_scrdata.pixbuf = NULL;
|
||||||
@@ -543,7 +544,7 @@ void CCDraw::paintFbItems(bool do_save_bg)
|
|||||||
frameBuffer->paintBackgroundBoxRel(x, y, fbdata.dx, fbdata.dy);
|
frameBuffer->paintBackgroundBoxRel(x, y, fbdata.dx, fbdata.dy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && !is_painted) { //TODO: is_painted is too global here, shadow will not paint on current instance without called kill/hide
|
if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && (!is_painted || shadow_force)) {
|
||||||
if (fbdata.enabled) {
|
if (fbdata.enabled) {
|
||||||
/* here we paint the shadow around the body
|
/* here we paint the shadow around the body
|
||||||
* on 1st step we check for already cached screen buffer, if true
|
* on 1st step we check for already cached screen buffer, if true
|
||||||
@@ -688,12 +689,13 @@ bool CCDraw::doPaintBg(bool do_paint)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCDraw::enableShadow(int mode, const int& shadow_width)
|
void CCDraw::enableShadow(int mode, const int& shadow_width, bool force_paint)
|
||||||
{
|
{
|
||||||
if (shadow != mode)
|
if (shadow != mode)
|
||||||
shadow = mode;
|
shadow = mode;
|
||||||
if (shadow != CC_SHADOW_OFF)
|
if (shadow != CC_SHADOW_OFF)
|
||||||
if (shadow_width != -1)
|
if (shadow_width != -1)
|
||||||
setShadowWidth(shadow_width);
|
setShadowWidth(shadow_width);
|
||||||
|
shadow_force = force_paint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -84,6 +84,8 @@ class CCDraw : public COSDFader, public CComponentsSignals
|
|||||||
int shadow;
|
int shadow;
|
||||||
///property: width of shadow
|
///property: width of shadow
|
||||||
int shadow_w, shadow_w_old;
|
int shadow_w, shadow_w_old;
|
||||||
|
///property: force shadow paint, see enableShadow()
|
||||||
|
bool shadow_force;
|
||||||
|
|
||||||
///returns true if internal property was changed
|
///returns true if internal property was changed
|
||||||
virtual bool hasChanges();
|
virtual bool hasChanges();
|
||||||
@@ -245,8 +247,11 @@ class CCDraw : public COSDFader, public CComponentsSignals
|
|||||||
|
|
||||||
///switch shadow on/off
|
///switch shadow on/off
|
||||||
virtual void setShadowWidth(const int& shadow_width){if (shadow_w != shadow_width) shadow_w = shadow_width;}
|
virtual void setShadowWidth(const int& shadow_width){if (shadow_w != shadow_width) shadow_w = shadow_width;}
|
||||||
///Note: it's recommended to use #defines: CC_SHADOW_ON=true or CC_SHADOW_OFF=false as parameter, see also cc_types.h
|
/**1st parameter requires defines CC_SHADOW_ON (default), CC_SHADOW_OFF, CC_SHADOW_BOTTOM or CC_SHADOW_RIGHT, see also cc_types.h
|
||||||
virtual void enableShadow(int mode = CC_SHADOW_ON, const int& shadow_width = -1);
|
* 2nd parameter defines shadow width, default = defined by system
|
||||||
|
* 3rd parameter forces paint of shadow layer, default = false, Note: default shadow will paint only on first paint, use 3rd parameter=true ignores this
|
||||||
|
*/
|
||||||
|
virtual void enableShadow(int mode = CC_SHADOW_ON, const int& shadow_width = -1, bool force_paint = false);
|
||||||
///switch shadow off
|
///switch shadow off
|
||||||
virtual void disableShadow(){enableShadow(CC_SHADOW_OFF);}
|
virtual void disableShadow(){enableShadow(CC_SHADOW_OFF);}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user