diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index feda1034f..6f946a3ab 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -72,7 +72,7 @@ void CImageInfo::Init(void) item_offset = 10; item_font = NULL; item_height = 0; - + y_tmp = 0; license_txt = ""; v_info.clear(); config.loadConfig(VERSION_FILE); @@ -351,8 +351,9 @@ void CImageInfo::InitInfos() cc_info->setWidth(cc_win->getWidth() - cc_tv->getWidth() - 2*item_offset); //create label and text items + y_tmp = 0; for (size_t i=0; igetWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); + CComponentsExtTextForm *item = new CComponentsExtTextForm(1, y_tmp, cc_info->getWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); item->setLabelWidthPercent(20); if (!item_font){ @@ -363,16 +364,13 @@ void CImageInfo::InitInfos() item->setHeight(item_height); cc_info->setHeight(v_info.size()*item_height); - if ((i == 0) && (item->getYPos() == CC_APPEND)) - item->setYPos(1); - //add ext-text object to window body if (!item->isAdded()) cc_info->addCCItem(item); //add an offset before homepage and license and at the end if (v_info[i].caption == LOCALE_IMAGEINFO_CREATOR || v_info[i].caption == LOCALE_IMAGEINFO_FORUM){ - CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, CC_APPEND, 1, item_offset); + CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, y_tmp+=item_offset, 1, item_offset); //spacer ist not visible! spacer->allowPaint(false); cc_info->addCCItem(spacer); @@ -380,6 +378,7 @@ void CImageInfo::InitInfos() int tmp_h = cc_info->getHeight(); cc_info->setHeight(tmp_h + item_offset); } + y_tmp += item->getHeight(); } } @@ -414,7 +413,7 @@ void CImageInfo::InitInfoText(const std::string& text) Font * caption_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; int caption_height = caption_font->getHeight(); if (cc_sub_caption == NULL) - cc_sub_caption = new CComponentsLabel(cc_info->getXPos(), CC_APPEND, cc_info->getWidth(), caption_height, + cc_sub_caption = new CComponentsLabel(cc_info->getXPos(), y_tmp, cc_info->getWidth(), caption_height, g_Locale->getText(LOCALE_IMAGEINFO_LICENSE), CTextBox::AUTO_WIDTH, item_font); if (!cc_sub_caption->isAdded()) cc_win->addWindowItem(cc_sub_caption); @@ -423,9 +422,9 @@ void CImageInfo::InitInfoText(const std::string& text) int h_txt = h_body - item_offset - cc_info->getHeight() - cc_sub_caption->getHeight() - item_offset; if (cc_lic == NULL) - cc_lic = new CComponentsInfoBox(CC_CENTERED, CC_APPEND, w_body-2*item_offset, h_txt); + cc_lic = new CComponentsInfoBox(CC_CENTERED, y_tmp+=cc_sub_caption->getHeight(), w_body-2*item_offset, h_txt); cc_lic->setSpaceOffset(1); - cc_lic->setText(text, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); + cc_lic->setText(text, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL, item_font); cc_lic->doPaintTextBoxBg(true); //add text to container diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index a243866b4..9d6e399f8 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -50,7 +50,7 @@ class CImageInfo : public CMenuTarget std::string license_txt; Font* item_font; int item_height; - + int y_tmp; std::vector v_info; void Clean();