From 903f2ca74df715f2e5cfc5a615f599042a66b040 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 4 Dec 2016 00:48:32 +0100 Subject: [PATCH] - helpbox: bind gradient of separatorline to user's setting --- src/gui/widget/helpbox.cpp | 9 ++++++--- src/gui/widget/helpbox.h | 3 +-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index 66cd9d4f2..75969a502 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -118,7 +118,7 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in -void Helpbox::addSeparatorLine(const int& line_space, const int& line_indent, bool enable_gradient) +void Helpbox::addSeparatorLine(const int& line_space, const int& line_indent) { CComponentsItem *pre_item = !ccw_body->empty() ? ccw_body->back() : NULL; //get the last current item @@ -140,8 +140,11 @@ void Helpbox::addSeparatorLine(const int& line_space, const int& line_indent, bo CComponentsShapeSquare *sepline = new CComponentsShapeSquare (0, 0, line->getWidth(), 2); sepline->setYPos(line->getHeight()/2 - sepline->getHeight()/2); sepline->setColorBody(COL_MENUCONTENTINACTIVE_TEXT); - sepline->enableColBodyGradient(enable_gradient); - sepline->setColBodyGradient(CColorGradient::gradientLight2Dark, CFrameBuffer::gradientHorizontal, CColorGradient::light); + if (g_settings.theme.menu_Separator_gradient_enable) + { + sepline->enableColBodyGradient(true); + sepline->setColBodyGradient(CColorGradient::gradientLight2Dark, CFrameBuffer::gradientHorizontal, CColorGradient::light); + } line->addCCItem(sepline); diff --git a/src/gui/widget/helpbox.h b/src/gui/widget/helpbox.h index 86a5aed4b..b59b36050 100644 --- a/src/gui/widget/helpbox.h +++ b/src/gui/widget/helpbox.h @@ -82,8 +82,7 @@ public: ///arg 'line_indent' defines begin of line from left border within body object. ///arg 'enable_gradient' enable/disable gradient, Note: default = true, but gradient is only effected, if global/theme gradient settings are enabled! void addSeparatorLine( const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT, - const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, - bool enable_gradient = true); + const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT); ///adds a simple empty separator as horizontal space, arg 'line_space' defines the space of full separator height void addSeparator( const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT);