From c18613500af0dfe7a3e4e8df9f05b6163e576eb3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 23 Jan 2018 15:08:16 +0100 Subject: [PATCH] src/gui/widget/navibar.cpp/h: fix icon scale Remove CComponentsPictureScalable class, is not longer required. Scale for navi button icons should working now. Note: It is not sure if the setting of OFFSET_INNER_MID makes sense here, because it is possible that a scaling could happen even though the icon would be fit. --- src/gui/widget/navibar.cpp | 14 ++++++++++---- src/gui/widget/navibar.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/navibar.cpp b/src/gui/widget/navibar.cpp index 6afb1d46e..8fcf7c66e 100644 --- a/src/gui/widget/navibar.cpp +++ b/src/gui/widget/navibar.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Class for epg window navigation bar. - Copyright (C) 2017, Thilo Graf 'dbt' + Copyright (C) 2017-2018, Thilo Graf 'dbt' License: GPL @@ -68,10 +68,14 @@ void CNaviBar::initCCItems() int mid_width = width * 40 / 100; // 40% int side_width = ((width - mid_width) / 2) - (2 * x_off); int h_text = height; + int icon_h, icon_w; // init left arrow if (!nb_lpic){ - nb_lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT); + nb_lpic = new CComponentsPicture(x_off,CC_CENTERED, CFrameBuffer::getInstance()->getIconPath(NEUTRINO_ICON_BUTTON_LEFT)); + nb_lpic->getRealSize(&icon_h, &icon_w); + if ((icon_h + 2*OFFSET_INNER_MIN) > (height + 2*OFFSET_INNER_MIN)) + nb_lpic->setHeight(height - 2*OFFSET_INNER_MIN, true); nb_lpic->doPaintBg(false); this->addCCItem(nb_lpic); nb_lpic->enableSaveBg(); @@ -80,8 +84,10 @@ void CNaviBar::initCCItems() // init right arrow if (!nb_rpic){ - nb_rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT); - + nb_rpic = new CComponentsPicture(0,CC_CENTERED, CFrameBuffer::getInstance()->getIconPath(NEUTRINO_ICON_BUTTON_RIGHT)); + nb_rpic->getRealSize(&icon_h, &icon_w); + if ((icon_h + 2*OFFSET_INNER_MIN) > (height + 2*OFFSET_INNER_MIN)) + nb_rpic->setHeight(height - 2*OFFSET_INNER_MIN, true); nb_rpic->doPaintBg(false); this->addCCItem(nb_rpic); nb_rpic->enableSaveBg(); diff --git a/src/gui/widget/navibar.h b/src/gui/widget/navibar.h index 9ea3dee50..48740ec04 100644 --- a/src/gui/widget/navibar.h +++ b/src/gui/widget/navibar.h @@ -38,7 +38,7 @@ class CNaviBar : public CComponentsFrmChain { private: - CComponentsPictureScalable *nb_lpic, *nb_rpic; + CComponentsPicture *nb_lpic, *nb_rpic; CComponentsText *nb_lText, *nb_rText; Font *nb_font;