From 89bdf8266d2bc476612325f72bc31df3615e848d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 2 Dec 2021 13:50:51 +0100 Subject: [PATCH] cc_frm_header: remove check for icon instance Define of icon after created instance was partial broken. In some cases no icon was visible. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b6606d1abeb544e3b1bc05dc8e3007c3d6a45c6e Author: Thilo Graf Date: 2021-12-02 (Thu, 02 Dec 2021) --- src/gui/components/cc_frm_header.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 191cfe037..67e72e653 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -269,24 +269,23 @@ void CComponentsHeader::initIcon() //create instance for cch_icon_obj and add to container at once if (cch_icon_obj == NULL){ dprintf(DEBUG_DEBUG, "[CComponentsHeader]\n [%s - %d] init header icon: %s\n", __func__, __LINE__, cch_icon_name.c_str()); - cch_icon_obj = new CComponentsPicture(cch_icon_x, cch_items_y, "blank", this); + cch_icon_obj = new CComponentsPicture(cch_icon_x, cch_items_y, "", this); } //set properties for icon object - if (cch_icon_obj){ - //set corner mode of icon item - int cc_icon_corner_type = CORNER_LEFT; - if (corner_type & CORNER_TOP_LEFT || corner_type & CORNER_TOP) - cc_icon_corner_type = CORNER_TOP_LEFT; - cch_icon_obj->setCorner(corner_rad-fr_thickness, cc_icon_corner_type); + //set corner mode of icon item + int cc_icon_corner_type = CORNER_LEFT; + if (corner_type & CORNER_TOP_LEFT || corner_type & CORNER_TOP) + cc_icon_corner_type = CORNER_TOP_LEFT; + cch_icon_obj->setCorner(corner_rad-fr_thickness, cc_icon_corner_type); - cch_icon_obj->setPicture(cch_icon_name); - int dx_tmp = 0, dy_tmp = 0; - cch_icon_obj->getRealSize(&dx_tmp, &dy_tmp); - cch_icon_obj->setHeight(min(height, dy_tmp)); + cch_icon_obj->setPicture(cch_icon_name); + int dx_tmp = 0, dy_tmp = 0; + cch_icon_obj->getRealSize(&dx_tmp, &dy_tmp); + cch_icon_obj->setHeight(min(height, dy_tmp)); + + cch_icon_w = cch_icon_obj->getWidth(); - cch_icon_w = cch_icon_obj->getWidth(); - } } void CComponentsHeader::initLogo()