From 107db09299f528ab0cea8bd7970a8aedb716d258 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 May 2017 10:42:08 +0200 Subject: [PATCH] CComponentsHeader: fix order of width calculation Required for following position calculation --- src/gui/components/cc_frm_header.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f6e20c5a0..21633e22c 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -576,20 +576,20 @@ void CComponentsHeader::initCaption() //set header text properties if (cch_text_obj){ + //recalc caption width + cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)/*+ OFFSET_INNER_MID*/); + //set alignment of text item in dependency from text alignment if (cch_caption_align == CTextBox::CENTER) cch_text_x = CC_CENTERED; - //recalc caption width - cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); - //assign general properties cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height); cch_text_obj->setColorBody(col_body); if (cc_body_gradient_enable != cc_body_gradient_enable_old) cch_text_obj->getCTextBoxObject()->clearScreenBuffer(); cch_text_obj->setTextColor(cch_col_text); - cch_text_obj->setText(cch_text, cch_caption_align, cch_font); + cch_text_obj->setText(cch_text, cch_caption_align, cch_font, cch_col_text); cch_text_obj->enableTboxSaveScreen(cc_body_gradient_enable || cc_txt_save_screen); //corner of text item