From b7b2998720f3cec5302d6e0677ac0ad8debf0673 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Fri, 10 Jan 2014 14:24:07 -0600 Subject: [PATCH] Added center theme option for TextListComponent. --- THEMES.md | 1 + src/ThemeData.cpp | 3 ++- src/components/TextListComponent.h | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/THEMES.md b/THEMES.md index 196e0d03b..b472a41d3 100644 --- a/THEMES.md +++ b/THEMES.md @@ -243,6 +243,7 @@ Reference * `fontPath` - type: PATH. * `fontSize` - type: FLOAT. * `scrollSound` - type: PATH. + * `center` - type: BOOLEAN. #### container * `pos` - type: NORMALIZED_PAIR. diff --git a/src/ThemeData.cpp b/src/ThemeData.cpp index 8d68dec20..d345253fb 100644 --- a/src/ThemeData.cpp +++ b/src/ThemeData.cpp @@ -34,7 +34,8 @@ std::map< std::string, std::map > T ("secondaryColor", COLOR) ("fontPath", PATH) ("fontSize", FLOAT) - ("scrollSound", PATH)) + ("scrollSound", PATH) + ("center", BOOLEAN)) ("container", boost::assign::map_list_of ("pos", NORMALIZED_PAIR) ("size", NORMALIZED_PAIR)) diff --git a/src/components/TextListComponent.h b/src/components/TextListComponent.h index 97e55e4ff..4c4279a38 100644 --- a/src/components/TextListComponent.h +++ b/src/components/TextListComponent.h @@ -433,6 +433,9 @@ void TextListComponent::applyTheme(const std::shared_ptr& theme, c if(properties & SOUND && elem->has("scrollSound")) setSound(Sound::get(elem->get("scrollSound"))); + + if(properties & CENTER && elem->has("center")) + mCentered = elem->get("center"); } #endif