mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
CComponentsFooter: use dynamic font on too small footer width
If required width of evaluated buttons larger than footer width, then use dynamic font for caption, and try to fit buttons into chain container. Dynamic font is used if ccf_btn_font==NULL NOTE: user should not use too small window size and not select too large fontsize. At some point this possibility will be depleted and it's no more space for readable caption.
This commit is contained in:
@@ -169,6 +169,14 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont
|
||||
//set x position of 1st button object inside chain, this is centering button objects inside chain
|
||||
int x_1st_btn = btn_offset/2;
|
||||
chain->getCCItem(0)->setXPos(x_1st_btn);
|
||||
|
||||
//check used width of generated buttons, if required then use dynamic font, and try to fit buttons into chain container, dynamic font is used if ccf_btn_font==NULL
|
||||
//NOTE: user should be set not too small window size and not too large fontsize, at some point this possibility will be depleted and it's no more space for readable caption
|
||||
if (w_used > width && ccf_btn_font != NULL){
|
||||
chain->clear();
|
||||
ccf_btn_font = NULL;
|
||||
setButtonLabels(content, label_count, chain_width, label_width);
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentsFooter::setButtonLabels(const struct button_label_l * const content, const size_t& label_count, const int& chain_width, const int& label_width)
|
||||
|
Reference in New Issue
Block a user