CComponentsTitleBar: rename member addText(), convert locale in constructor

This commit is contained in:
2012-08-30 22:48:40 +02:00
parent 936e965909
commit f45246caed
2 changed files with 6 additions and 9 deletions

View File

@@ -371,7 +371,7 @@ class CComponentsTitleBar : public CComponentsItemBox
neutrino_locale_t tb_locale_text;
int tb_text_align;
bool addText();
bool initText();
void initVarTitleBar();
public:

View File

@@ -1209,7 +1209,7 @@ CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const
tb_c_text = c_text;
tb_text_align = text_alignment;
if (addText())
if (initText())
calculateElements();
}
@@ -1231,7 +1231,7 @@ CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const
tb_s_text = s_text;
tb_text_align = text_alignment;
if (addText())
if (initText())
calculateElements();
}
@@ -1251,13 +1251,14 @@ CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const
//CComponentsTitleBar
tb_locale_text = locale_text;
tb_s_text = g_Locale->getText(tb_locale_text);
tb_text_align = text_alignment;
if (addText())
if (initText())
calculateElements();
}
bool CComponentsTitleBar::addText()
bool CComponentsTitleBar::initText()
{
if (tb_c_text){
addElement (tb_text_align, CC_ITEMBOX_TEXT, tb_c_text);
@@ -1267,10 +1268,6 @@ bool CComponentsTitleBar::addText()
addElement (tb_text_align, CC_ITEMBOX_TEXT, tb_s_text);
return true;
}
else if (tb_locale_text != NONEXISTANT_LOCALE){
addElement (tb_text_align, CC_ITEMBOX_TEXT, g_Locale->getText(tb_locale_text));
return true;
}
else
return false;
}