mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 13:05:20 +02:00
Wrap long subtitles to multiple lines in Dialog::writeSubTitle
Setting descriptions and help prompts now appear fully even if they are longer than the screen allows. Translations do not need to worry about allowed text being wider than the screen in some fonts anymore.
This commit is contained in:
parent
485bab3b48
commit
15472a073e
@ -31,14 +31,15 @@ void Dialog::writeTitle(const std::string &title, Surface *s)
|
||||
{
|
||||
if (s==NULL)
|
||||
s = gmenu2x->s;
|
||||
s->write(gmenu2x->font, title, 40, gmenu2x->skinConfInt["topBarHeight"] / 4, Font::HAlignLeft, Font::VAlignMiddle);
|
||||
s->write(gmenu2x->font, title, 40, 0, Font::HAlignLeft, Font::VAlignTop);
|
||||
}
|
||||
|
||||
void Dialog::writeSubTitle(const std::string &subtitle, Surface *s)
|
||||
{
|
||||
if (s==NULL)
|
||||
s = gmenu2x->s;
|
||||
s->write(gmenu2x->font, subtitle, 40, gmenu2x->skinConfInt["topBarHeight"] / 4 * 3, Font::HAlignLeft, Font::VAlignMiddle);
|
||||
std::string wrapped = gmenu2x->font->wordWrap(subtitle, gmenu2x->resX - 48);
|
||||
s->write(gmenu2x->font, wrapped, 40, gmenu2x->skinConfInt["topBarHeight"] - gmenu2x->font->getTextHeight(wrapped), Font::HAlignLeft, Font::VAlignTop);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user