From 78cdac6177e836226b0bca5b9ca992432c5b4e06 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 29 Apr 2025 19:12:11 +0300 Subject: code cleaning --- plugins/NewStory/src/history_control.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index bbfda96e28..207972c5f7 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -729,6 +729,16 @@ void NewstoryListData::OpenFolder() ///////////////////////////////////////////////////////////////////////////////////////// // Painting +static void recursive_set_color(element::ptr el, const web_color &fore, const background &back) +{ + el->css_w().set_bg(back); + el->css_w().set_color(fore); + + for (auto &it : el->children()) + if (it->tag() != _a_) + recursive_set_color(it, fore, back); +} + void NewstoryListData::Paint(simpledib::dib &dib) { int top = 0; @@ -869,14 +879,7 @@ void NewstoryListData::Paint(simpledib::dib &dib) back.m_color = litehtml::web_color(GetRValue(clBack), GetGValue(clBack), GetBValue(clBack)); litehtml::web_color fore(GetRValue(clText), GetGValue(clText), GetBValue(clText)); - - pBbody->css_w().set_bg(back); - pBbody->css_w().set_color(fore); - - for (auto &it : pBbody->children()) { - it->css_w().set_bg(back); - it->css_w().set_color(fore); - } + recursive_set_color(pBbody, fore, back); } } -- cgit v1.2.3