CComponentsHeader: fix order of width calculation

Required for following position calculation
This commit is contained in:
2017-05-10 10:42:08 +02:00
parent c08144a9d9
commit 107db09299

View File

@@ -576,20 +576,20 @@ void CComponentsHeader::initCaption()
//set header text properties //set header text properties
if (cch_text_obj){ 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 //set alignment of text item in dependency from text alignment
if (cch_caption_align == CTextBox::CENTER) if (cch_caption_align == CTextBox::CENTER)
cch_text_x = CC_CENTERED; 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 //assign general properties
cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height); cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height);
cch_text_obj->setColorBody(col_body); cch_text_obj->setColorBody(col_body);
if (cc_body_gradient_enable != cc_body_gradient_enable_old) if (cc_body_gradient_enable != cc_body_gradient_enable_old)
cch_text_obj->getCTextBoxObject()->clearScreenBuffer(); cch_text_obj->getCTextBoxObject()->clearScreenBuffer();
cch_text_obj->setTextColor(cch_col_text); 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); cch_text_obj->enableTboxSaveScreen(cc_body_gradient_enable || cc_txt_save_screen);
//corner of text item //corner of text item