From b44b37d4ca4f0bbfe2b578dc72d84ba71286cc92 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Tue, 15 Jul 2008 10:50:31 +0000 Subject: More widgets. svn-id: r33071 --- gui/ThemeRenderer.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'gui/ThemeRenderer.h') diff --git a/gui/ThemeRenderer.h b/gui/ThemeRenderer.h index a9c597f60f..ba6cf633b0 100644 --- a/gui/ThemeRenderer.h +++ b/gui/ThemeRenderer.h @@ -112,8 +112,17 @@ public: kDDCaret, kDDSeparator, + kDDDefaultText, kDrawDataMAX }; + + enum TextColor { + kTextColorDefault, + kTextColorHover, + kTextColorDisabled, + kTextColorInverted, + kTextColorMAX + }; ThemeRenderer(Common::String themeName, GraphicsMode mode); @@ -160,7 +169,7 @@ public: void drawLineSeparator(const Common::Rect &r, WidgetStateInfo state = kStateEnabled); void drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state); - void drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state, TextAlign align, bool inverted, int deltax, bool useEllipsis, FontStyle font) {} + void drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state, TextAlign align, bool inverted, int deltax, bool useEllipsis, FontStyle font); void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state) {} bool addDirtyRect(Common::Rect r, bool backup = false, bool special = false) { @@ -254,6 +263,19 @@ protected: int getTabPadding() const { return 3; } + + uint32 getTextColor(WidgetStateInfo state) { + switch (state) { + case kStateDisabled: + return _textColors[kTextColorDisabled]; + + case kStateHighlight: + return _textColors[kTextColorHover]; + + default: + return _textColors[kTextColorDefault]; + } + } OSystem *_system; Graphics::VectorRenderer *_vectorRenderer; @@ -266,6 +288,7 @@ protected: Common::String _fontName; const Graphics::Font *_font; + uint32 _textColors[kTextColorMAX]; WidgetDrawData *_widgets[kDrawDataMAX]; Common::Array _dirtyScreen; -- cgit v1.2.3