Added center theme option for TextListComponent.

This commit is contained in:
Aloshi 2014-01-10 14:24:07 -06:00
parent 997751f56a
commit b7b2998720
3 changed files with 6 additions and 1 deletions

View file

@ -243,6 +243,7 @@ Reference
* `fontPath` - type: PATH.
* `fontSize` - type: FLOAT.
* `scrollSound` - type: PATH.
* `center` - type: BOOLEAN.
#### container
* `pos` - type: NORMALIZED_PAIR.

View file

@ -34,7 +34,8 @@ std::map< std::string, std::map<std::string, ThemeData::ElementPropertyType> > 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))

View file

@ -433,6 +433,9 @@ void TextListComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme, c
if(properties & SOUND && elem->has("scrollSound"))
setSound(Sound::get(elem->get<std::string>("scrollSound")));
if(properties & CENTER && elem->has("center"))
mCentered = elem->get<bool>("center");
}
#endif