aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeEngine.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2009-07-15 18:05:37 +0000
committerJohannes Schickel2009-07-15 18:05:37 +0000
commit6a26f1b56f0317af4099c978a5cd1511d7fbcb7c (patch)
treec1adc6c8e14b885c4d0a1737bf32d3b02b4fe4af /gui/ThemeEngine.cpp
parent6a15e14d3ff0804efb08020c86c60c6c818aa1b4 (diff)
downloadscummvm-rg350-6a26f1b56f0317af4099c978a5cd1511d7fbcb7c.tar.gz
scummvm-rg350-6a26f1b56f0317af4099c978a5cd1511d7fbcb7c.tar.bz2
scummvm-rg350-6a26f1b56f0317af4099c978a5cd1511d7fbcb7c.zip
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
Diffstat (limited to 'gui/ThemeEngine.cpp')
-rw-r--r--gui/ThemeEngine.cpp14
1 files changed, 12 insertions, 2 deletions
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) {