mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
CComponentsItem: move initBodyGradient() into base class
This provides functinality for all sub classes too
Origin commit data
------------------
Commit: 581405e076
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-09-20 (Sat, 20 Sep 2014)
This commit is contained in:
@@ -67,6 +67,10 @@ void CComponentsItem::initParent(CComponentsForm* parent)
|
||||
// If backround is not required, it's possible to override this with variable paint_bg=false, use doPaintBg(true/false) to set this!
|
||||
void CComponentsItem::paintInit(bool do_save_bg)
|
||||
{
|
||||
//init color gradient
|
||||
if (col_body_gradient)
|
||||
initBodyGradient();
|
||||
|
||||
clearFbData();
|
||||
|
||||
int th = fr_thickness;
|
||||
@@ -230,3 +234,14 @@ void CComponentsItem::setFocus(bool focus)
|
||||
}
|
||||
cc_has_focus = focus;
|
||||
}
|
||||
|
||||
void CComponentsItem::initBodyGradient()
|
||||
{
|
||||
if (cc_gradientBuf == NULL) {
|
||||
CColorGradient ccGradient;
|
||||
cc_gradientBuf = ccGradient.gradientOneColor(col_body, NULL, height, CColorGradient::gradientLight2Dark, CColorGradient::light);
|
||||
}
|
||||
cc_gradientData.gradientBuf = cc_gradientBuf;
|
||||
cc_gradientData.direction = CFrameBuffer::gradientVertical;
|
||||
cc_gradientData.mode = CFrameBuffer::pbrg_noOption;
|
||||
}
|
||||
|
Reference in New Issue
Block a user