From 62a9621cb0ec860a44759bc32947453d9612662a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 7 May 2015 16:39:28 +0300 Subject: [PATCH] gui/components/cc_item.cpp: use theme option for one/two color gradient --- src/gui/components/cc_base.h | 1 + src/gui/components/cc_item.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h index f641e44d1..38663aeac 100644 --- a/src/gui/components/cc_base.h +++ b/src/gui/components/cc_base.h @@ -73,6 +73,7 @@ class CComponents : public CComponentsSignals, public COSDFader ///property: color of body fb_pixel_t col_body; fb_pixel_t old_gradient_color; + int old_gradient_c2c; ///property: color of shadow fb_pixel_t col_shadow; ///property: color of frame diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 28e822602..2c2b158e0 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -257,7 +257,7 @@ void CComponentsItem::setFocus(bool focus) void CComponentsItem::initBodyGradient() { - if (col_body_gradient && cc_gradientData.gradientBuf && old_gradient_color != col_body) { + if (col_body_gradient && cc_gradientData.gradientBuf && (old_gradient_color != col_body || old_gradient_c2c != g_settings.theme.gradient_c2c)) { free(cc_gradientData.gradientBuf); cc_gradientData.gradientBuf = NULL; if (cc_gradientData.boxBuf) { @@ -268,11 +268,12 @@ void CComponentsItem::initBodyGradient() if (cc_gradientData.gradientBuf == NULL) { CColorGradient ccGradient; int gsize = cc_body_gradient_direction == CFrameBuffer::gradientVertical ? height : width; - if (cc_body_gradient_c2c) + if (g_settings.theme.gradient_c2c) cc_gradientData.gradientBuf = ccGradient.gradientColorToColor(col_body, cc_body_gradient_2nd_col, NULL, gsize, cc_body_gradient_mode, cc_body_gradient_intensity); else cc_gradientData.gradientBuf = ccGradient.gradientOneColor(col_body, NULL, gsize, cc_body_gradient_mode, cc_body_gradient_intensity, cc_body_gradient_intensity_v_min, cc_body_gradient_intensity_v_max, cc_body_gradient_saturation); old_gradient_color = col_body; + old_gradient_c2c = g_settings.theme.gradient_c2c; } cc_gradientData.direction = cc_body_gradient_direction;