mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
CComponentsExtTextForm: fix label width calculation
This commit is contained in:
@@ -86,8 +86,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p
|
|||||||
width = w;
|
width = w;
|
||||||
//init ccx_label_width and ccx_text_width
|
//init ccx_label_width and ccx_text_width
|
||||||
//default ccx_label_width = 30% of form width
|
//default ccx_label_width = 30% of form width
|
||||||
ccx_percent_label_w = DEF_LABEL_WIDTH_PERCENT;
|
ccx_label_width = DEF_LABEL_WIDTH_PERCENT * width/100;
|
||||||
ccx_label_width = ccx_percent_label_w * width/100;
|
|
||||||
ccx_text_width = width-ccx_label_width;
|
ccx_text_width = width-ccx_label_width;
|
||||||
|
|
||||||
height = h;
|
height = h;
|
||||||
@@ -223,7 +222,8 @@ void CComponentsExtTextForm::initCCTextItems()
|
|||||||
|
|
||||||
void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val)
|
void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val)
|
||||||
{
|
{
|
||||||
ccx_percent_label_w = (int)percent_val;
|
ccx_label_width = (int)percent_val * width/100;
|
||||||
|
ccx_text_width = width-ccx_label_width;
|
||||||
initCCTextItems();
|
initCCTextItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,8 +49,6 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen
|
|||||||
int ccx_text_width;
|
int ccx_text_width;
|
||||||
///property: font type of both items (label and text), see also setLabelAndText()
|
///property: font type of both items (label and text), see also setLabelAndText()
|
||||||
Font* ccx_font;
|
Font* ccx_font;
|
||||||
///property: percentage val of label width related to full width, causes fit of text automatically into the available remaining size of item, see also setLabelWidthPercent()
|
|
||||||
uint8_t ccx_percent_label_w;
|
|
||||||
///centered y position of label and text
|
///centered y position of label and text
|
||||||
int y_text;
|
int y_text;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user