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 | ||
---|---|---|
31 | 31 | { |
32 | 32 | if (s==NULL) |
33 | 33 | 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); | |
35 | 35 | } |
36 | 36 | |
37 | 37 | void Dialog::writeSubTitle(const std::string &subtitle, Surface *s) |
38 | 38 | { |
39 | 39 | if (s==NULL) |
40 | 40 | 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); | |
42 | 43 | } |
43 | 44 | |
44 | 45 |
Branches:
install_locations
master
opkrun
packages