From 5678da177e8b5f7a9198d5756b16923a29e94046 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 13 Aug 2017 23:07:28 +0200 Subject: [PATCH] CMenuWidget: replace paintBoxRel() calls with single PaintBoxRel() Paints background and shadow at once. Shadow is painted only on reqiured parts of screen. This avoids possible flicker effects e.g. with footer paint, on changing buttons, was to see with opkg_manager. --- src/gui/widget/menue.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 69f8af3b0..38aada0f5 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1268,10 +1268,9 @@ void CMenuWidget::paint() header->enableGradientBgCleanUp(savescreen); header->paint(CC_SAVE_SCREEN_NO); - // paint body and footer shadow - frameBuffer->paintBoxRel(x+OFFSET_SHADOW, y + hheight + OFFSET_SHADOW, width + scrollbar_width, height - hheight + (fbutton_count ? footer_height : 0), COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // paint body background - frameBuffer->paintBoxRel(x, y + hheight, width + scrollbar_width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, (fbutton_count ? CORNER_NONE : CORNER_BOTTOM)); + PaintBoxRel(x, y+hheight, width + scrollbar_width, height-hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, + (fbutton_count ? CORNER_NONE : CORNER_BOTTOM), footer && fbutton_count ? CC_SHADOW_RIGHT_CORNER_ALL : CC_SHADOW_ON); item_start_y = y+hheight; paintItems(); @@ -1538,7 +1537,7 @@ void CMenuWidget::setFooter(const struct button_label *_fbutton_labels, const in if (fbutton_count){ if (!footer) - footer = new CComponentsFooter(x, y + height, width + scrollbar_width); + footer = new CComponentsFooter(x, y + height, width + scrollbar_width, 0, 0, NULL, CC_SHADOW_ON); footer->setWidth(width + scrollbar_width); footer->setButtonLabels(fbutton_labels, fbutton_count, 0, width/fbutton_count); footer_height = footer->getHeight();