GUI: Unify clip and non-clip draw calls
This commit is contained in:
parent
dcfac42bb3
commit
4d29ce21d0
18 changed files with 156 additions and 573 deletions
|
@ -495,7 +495,8 @@ void ListWidget::drawWidget() {
|
|||
Common::String buffer;
|
||||
|
||||
// Draw a thin frame around the list.
|
||||
g_gui.theme()->drawWidgetBackgroundClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), 0, ThemeEngine::kWidgetBackgroundBorder);
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0,
|
||||
ThemeEngine::kWidgetBackgroundBorder);
|
||||
|
||||
// Draw the list items
|
||||
for (i = 0, pos = _currentPos; i < _entriesPerPage && pos < len; i++, pos++) {
|
||||
|
@ -513,8 +514,8 @@ void ListWidget::drawWidget() {
|
|||
// If in numbering mode, we first print a number prefix
|
||||
if (_numberingMode != kListNumberingOff) {
|
||||
buffer = Common::String::format("%2d. ", (pos + _numberingMode));
|
||||
g_gui.theme()->drawTextClip(Common::Rect(_x + _hlLeftPadding, y, _x + r.left + _leftPadding, y + fontHeight - 2),
|
||||
getBossClipRect(), buffer, _state, Graphics::kTextAlignLeft, inverted, _leftPadding, true);
|
||||
g_gui.theme()->drawText(Common::Rect(_x + _hlLeftPadding, y, _x + r.left + _leftPadding, y + fontHeight - 2),
|
||||
buffer, _state, Graphics::kTextAlignLeft, inverted, _leftPadding, true);
|
||||
pad = 0;
|
||||
}
|
||||
|
||||
|
@ -531,14 +532,12 @@ void ListWidget::drawWidget() {
|
|||
buffer = _editString;
|
||||
color = _editColor;
|
||||
adjustOffset();
|
||||
g_gui.theme()->drawTextClip(Common::Rect(_x + r.left, y, _x + r.right, y + fontHeight - 2),
|
||||
getBossClipRect(), buffer, _state,
|
||||
Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
|
||||
g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.right, y + fontHeight - 2), buffer, _state,
|
||||
Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
|
||||
} else {
|
||||
buffer = _list[pos];
|
||||
g_gui.theme()->drawTextClip(Common::Rect(_x + r.left, y, _x + r.right, y + fontHeight - 2),
|
||||
getBossClipRect(), buffer, _state,
|
||||
Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
|
||||
g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.right, y + fontHeight - 2), buffer, _state,
|
||||
Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue