mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Ratings are now themable.
This commit is contained in:
parent
43972c5be9
commit
5606a07f88
|
@ -50,6 +50,11 @@ std::map< std::string, std::map<std::string, ThemeData::ElementPropertyType> > T
|
|||
("color", COLOR)
|
||||
("fontPath", PATH)
|
||||
("fontSize", FLOAT))
|
||||
("rating", boost::assign::map_list_of
|
||||
("pos", NORMALIZED_PAIR)
|
||||
("size", NORMALIZED_PAIR)
|
||||
("filledPath", PATH)
|
||||
("unfilledPath", PATH))
|
||||
("sound", boost::assign::map_list_of
|
||||
("path", PATH));
|
||||
|
||||
|
|
|
@ -111,3 +111,19 @@ bool RatingComponent::input(InputConfig* config, Input input)
|
|||
|
||||
return GuiComponent::input(config, input);
|
||||
}
|
||||
|
||||
void RatingComponent::applyTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view, const std::string& element, unsigned int properties)
|
||||
{
|
||||
GuiComponent::applyTheme(theme, view, element, properties);
|
||||
|
||||
using namespace ThemeFlags;
|
||||
|
||||
const ThemeData::ThemeElement* elem = theme->getElement(view, element, "rating");
|
||||
if(!elem)
|
||||
return;
|
||||
|
||||
if(properties & PATH && elem->has("filledPath"))
|
||||
mFilledTexture = TextureResource::get(elem->get<std::string>("filledPath"), true);
|
||||
if(properties & PATH && elem->has("unfilledPath"))
|
||||
mUnfilledTexture = TextureResource::get(elem->get<std::string>("unfilledPath"), true);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@ public:
|
|||
void render(const Eigen::Affine3f& parentTrans);
|
||||
|
||||
void onSizeChanged() override;
|
||||
|
||||
virtual void applyTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view, const std::string& element, unsigned int properties) override;
|
||||
|
||||
private:
|
||||
void updateVertices();
|
||||
|
||||
|
|
Loading…
Reference in a new issue