From 95735f6faf26ac9bd9d8596d016db33f276c0963 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Oct 2016 13:15:57 +0200 Subject: [PATCH] CImageInfo: use matched fontsize for informations This window contains many lines and it's possible that some lines are truncated. if users have changed to extreme font sizes, So it is hopefully solved. --- src/gui/imageinfo.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 1dfde2eb6..57fcd7d48 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -70,8 +70,8 @@ void CImageInfo::Init(void) b_info = NULL; btn_red = NULL; item_offset = 10; - item_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; - item_height = item_font->getHeight(); + item_font = NULL; + item_height = 0; license_txt = ""; v_info.clear(); @@ -350,15 +350,18 @@ void CImageInfo::InitInfos() //set width, use size between left border and minitv cc_info->setWidth(cc_win->getWidth() - cc_tv->getWidth() - 2*item_offset); - //calculate initial height for info form - cc_info->setHeight(v_info.size()*item_height); - //create label and text items for (size_t i=0; igetWidth(), item_height, g_Locale->getText(v_info[i].caption), v_info[i].info_text); - item->setLabelAndTextFont(item_font); item->setLabelWidthPercent(20); + if (!item_font){ + item_font = item->getFont(); + //calculate initial height for info form + item_height = item_font->getHeight(); + cc_info->setHeight(v_info.size()*item_height); + } + if ((i == 0) && (item->getYPos() == CC_APPEND)) item->setYPos(1);