For a smoother user experience, use different colors for inverted text of the ListWidget, depending on whether the widget has focus or not.

svn-id: r42512
This commit is contained in:
Johannes Schickel 2009-07-15 18:05:37 +00:00
parent 6a15e14d3f
commit 6a26f1b56f
11 changed files with 376 additions and 334 deletions

View file

@ -404,11 +404,15 @@ void ListWidget::drawWidget() {
for (i = 0, pos = _currentPos; i < _entriesPerPage && pos < len; i++, pos++) {
const int y = _y + _topPadding + kLineHeight * i;
const int fontHeight = kLineHeight;
bool inverted = false;
ThemeEngine::TextInversionState inverted = ThemeEngine::kTextInversionNone;
// Draw the selected item inverted, on a highlighted background.
if (_selectedItem == pos)
inverted = true;
if (_selectedItem == pos) {
if (_hasFocus)
inverted = ThemeEngine::kTextInversionFocus;
else
inverted = ThemeEngine::kTextInversion;
}
Common::Rect r(getEditRect());
int pad = _leftPadding;