From 18695fb0c94884907bfe9d7d0c1e2b7d10dd7673 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 5 Nov 2016 21:13:58 +0100 Subject: [PATCH] CComponentsInfoBox: ensure matching object height after assigned image Images are not defined with constructor, so it is possible we must consider the image height after called setPicture() methode. This is important if an infobox sould be added into a cc form object. This avoids overlapping of dynamic added items. --- src/gui/components/cc_item_infobox.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index a2a6b6cbb..bc41347b0 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -83,6 +83,11 @@ CComponentsInfoBox::~CComponentsInfoBox() void CComponentsInfoBox::setPicture(const std::string& picture_name) { pic_name = picture_name; + if (!pic_name.empty()){ + int w, h; + frameBuffer->getIconSize(pic_name.c_str(), &w, &h); + height = max(h, height); + } } void CComponentsInfoBox::setPicture(const char* picture_name)