Date:2014-07-24 04:52:44 (9 years 8 months ago)
Author:Nebuleon Fumika
Commit:15472a073e7001f2d0c3f3c30e4f3ebf0fde4fff
Message: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.
Files: src/dialog.cpp (1 diff)

Change Details

src/dialog.cpp
3131{
3232    if (s==NULL)
3333        s = gmenu2x->s;
34    s->write(gmenu2x->font, title, 40, gmenu2x->skinConfInt["topBarHeight"] / 4, Font::HAlignLeft, Font::VAlignMiddle);
34    s->write(gmenu2x->font, title, 40, 0, Font::HAlignLeft, Font::VAlignTop);
3535}
3636
3737void Dialog::writeSubTitle(const std::string &subtitle, Surface *s)
3838{
3939    if (s==NULL)
4040        s = gmenu2x->s;
41    s->write(gmenu2x->font, subtitle, 40, gmenu2x->skinConfInt["topBarHeight"] / 4 * 3, Font::HAlignLeft, Font::VAlignMiddle);
41    std::string wrapped = gmenu2x->font->wordWrap(subtitle, gmenu2x->resX - 48);
42    s->write(gmenu2x->font, wrapped, 40, gmenu2x->skinConfInt["topBarHeight"] - gmenu2x->font->getTextHeight(wrapped), Font::HAlignLeft, Font::VAlignTop);
4243}
4344
4445

Archive Download the corresponding diff file



interactive