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

@ -167,6 +167,7 @@ static const DrawDataInfo kDrawDataDefaults[] = {
{kDDPlainColorBackground, "plain_bg", true, kDDNone},
{kDDDefaultBackground, "default_bg", true, kDDNone},
{kDDTextSelectionBackground, "text_selection", false, kDDNone},
{kDDTextSelectionFocusBackground, "text_selection_focus", false, kDDNone},
{kDDWidgetBackgroundDefault, "widget_default", true, kDDNone},
{kDDWidgetBackgroundSmall, "widget_small", true, kDDNone},
@ -1018,14 +1019,23 @@ void ThemeEngine::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, co
}
}
void ThemeEngine::drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state, Graphics::TextAlign align, bool inverted, int deltax, bool useEllipsis, FontStyle font) {
void ThemeEngine::drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state, Graphics::TextAlign align, TextInversionState inverted, int deltax, bool useEllipsis, FontStyle font) {
if (!ready())
return;
if (inverted) {
switch (inverted) {
case kTextInversion:
queueDD(kDDTextSelectionBackground, r);
queueDDText(kTextDataInverted, r, str, false, useEllipsis, align, kTextAlignVCenter, deltax);
return;
case kTextInversionFocus:
queueDD(kDDTextSelectionFocusBackground, r);
queueDDText(kTextDataInverted, r, str, false, useEllipsis, align, kTextAlignVCenter, deltax);
return;
default:
break;
}
switch (font) {