mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-22 20:21:06 +00:00
MACGUI: Explicitly use ellipsis to draw text when needed
This is the default, so this commit does not change the behaviour. But this will allow to change the default at a later stage.
This commit is contained in:
parent
4fa0f7c9ba
commit
bb98ce92f2
@ -1037,12 +1037,12 @@ bool MacMenu::draw(ManagedSurface *g, bool forceRedraw) {
|
||||
int accOff = _align == kTextAlignRight ? it->bbox.width() - _font->getStringWidth(it->unicodeText) : 0;
|
||||
Common::UnicodeBiDiText utxt(it->unicodeText);
|
||||
|
||||
_font->drawString(&_screen, utxt.visual, x, y, it->bbox.width(), color, _align);
|
||||
_font->drawString(&_screen, utxt.visual, x, y, it->bbox.width(), color, _align, 0, true);
|
||||
underlineAccelerator(&_screen, _font, utxt, x + accOff, y, it->shortcutPos, color);
|
||||
} else {
|
||||
const Font *font = getMenuFont(it->style);
|
||||
|
||||
font->drawString(&_screen, it->text, x, y, it->bbox.width(), color);
|
||||
font->drawString(&_screen, it->text, x, y, it->bbox.width(), color, Graphics::kTextAlignLeft, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1121,12 +1121,12 @@ void MacMenu::renderSubmenu(MacMenuSubMenu *menu, bool recursive) {
|
||||
|
||||
if (menu->items[i]->unicode) {
|
||||
Common::UnicodeBiDiText utxt(unicodeText);
|
||||
_font->drawString(s, utxt.visual, tx, ty, r->width(), color, _align);
|
||||
_font->drawString(s, utxt.visual, tx, ty, r->width(), color, _align, 0, true);
|
||||
underlineAccelerator(s, _font, utxt, tx + accOff, ty, shortcutPos, color);
|
||||
} else {
|
||||
const Font *font = getMenuFont(menu->items[i]->style);
|
||||
|
||||
font->drawString(s, text, tx, ty, r->width(), color);
|
||||
font->drawString(s, text, tx, ty, r->width(), color, Graphics::kTextAlignLeft, 0, true);
|
||||
}
|
||||
|
||||
if (menu->items[i]->checked) {
|
||||
|
@ -914,10 +914,10 @@ void MacText::render(int from, int to, int shadow) {
|
||||
|
||||
if (_textLines[i].chunks[j].plainByteMode()) {
|
||||
Common::String str = _textLines[i].chunks[j].getEncodedText();
|
||||
_textLines[i].chunks[j].getFont()->drawString(surface, str, xOffset, _textLines[i].y + yOffset, w, shadow ? _wm->_colorBlack : _textLines[i].chunks[j].fgcolor);
|
||||
_textLines[i].chunks[j].getFont()->drawString(surface, str, xOffset, _textLines[i].y + yOffset, w, shadow ? _wm->_colorBlack : _textLines[i].chunks[j].fgcolor, Graphics::kTextAlignLeft, 0, true);
|
||||
xOffset += _textLines[i].chunks[j].getFont()->getStringWidth(str);
|
||||
} else {
|
||||
_textLines[i].chunks[j].getFont()->drawString(surface, convertBiDiU32String(_textLines[i].chunks[j].text), xOffset, _textLines[i].y + yOffset, w, shadow ? _wm->_colorBlack : _textLines[i].chunks[j].fgcolor);
|
||||
_textLines[i].chunks[j].getFont()->drawString(surface, convertBiDiU32String(_textLines[i].chunks[j].text), xOffset, _textLines[i].y + yOffset, w, shadow ? _wm->_colorBlack : _textLines[i].chunks[j].fgcolor, Graphics::kTextAlignLeft, 0, true);
|
||||
xOffset += _textLines[i].chunks[j].getFont()->getStringWidth(_textLines[i].chunks[j].text);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user