From 6a26f1b56f0317af4099c978a5cd1511d7fbcb7c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 15 Jul 2009 18:05:37 +0000 Subject: 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 --- gui/ThemeEngine.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'gui/ThemeEngine.cpp') diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 166b11afe3..d1516d0f86 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -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) { -- cgit v1.2.3