I was having some problems with tab buttons today:
using this as an example string:
"[image='set:Images image:Image']Test"
The Tab button would display the image and the text - however the size of the tab itself would be as long as the string in width
I managed to fix this via editing CEGUITabControl.cpp: TabControl::calculateTabButtonSizePosition on at line 529+ so that it reads:
Code: Select all
// Width is based on font size (expressed as absolute)
if(btn->isTextParsingEnabled())
{
btn->setWidth(cegui_absdim(btn->getRenderedString().getPixelSize(0).d_width) +
getTabTextPadding() + getTabTextPadding());
}
else
{
Font* fnt = btn->getFont();
btn->setWidth(cegui_absdim(fnt->getTextExtent(btn->getText())) +
getTabTextPadding() + getTabTextPadding());
}
Is this a viable solution? and is the If statement even necessary?
Hopefully i didn't just overlook some setting somewhere and am not making a total fool of myself right now
