From e233c7467e748c416a2279f67666a60069721ca5 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Mon, 20 Aug 2012 21:17:09 +0200 Subject: [PATCH] CComponentsInfoBox: Use setTextFont() in paintText() --- src/gui/components/components.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/gui/components/components.cpp b/src/gui/components/components.cpp index a0e4bacf8..aa406ef01 100644 --- a/src/gui/components/components.cpp +++ b/src/gui/components/components.cpp @@ -364,27 +364,25 @@ void CComponentsInfoBox::paintText() box->iHeight = height-2*fr_thickness; //init textbox - if (textbox == NULL) + if (textbox == NULL) { textbox = new CTextBox(text, font, text_mode, box, col_body); + textbox->setTextBorderWidth(0); + textbox->enableBackgroundPaint(false); + } //set properties - textbox->setTextBorderWidth(0); + textbox->setTextFont(font); textbox->movePosition(box->iX, box->iY); textbox->setTextColor(col_text); - textbox->enableBackgroundPaint(false); //set text -// string new_text = static_cast (text); -// if (textbox->setText(&text)) + string new_text = static_cast (text); + if (textbox->setText(&new_text)) textbox->paint(); } void CComponentsInfoBox::paint(bool do_save_bg) { - if (textbox) { - delete textbox; - textbox = NULL; - } paintInit(do_save_bg); paintPicture(); if (text)