2011-07-13 23:12:36 +02:00
|
|
|
#include <global.h>
|
2011-04-17 21:14:24 +02:00
|
|
|
#include <graphics/fonts.h>
|
|
|
|
#include <ui/uilabelskin.h>
|
|
|
|
#include <ui/uilabel.h>
|
2011-04-11 22:06:03 +02:00
|
|
|
|
2011-07-13 23:12:36 +02:00
|
|
|
void UILabelSkin::load(OTMLNode* node)
|
2011-04-11 22:06:03 +02:00
|
|
|
{
|
|
|
|
UIElementSkin::load(node);
|
|
|
|
}
|
|
|
|
|
2011-04-17 02:36:58 +02:00
|
|
|
void UILabelSkin::apply(UIElement* element)
|
|
|
|
{
|
|
|
|
UIElementSkin::apply(element);
|
|
|
|
UILabel *label = static_cast<UILabel*>(element);
|
2011-05-12 00:16:11 +02:00
|
|
|
label->setSize(getFont()->calculateTextRectSize(label->getText()));
|
2011-04-17 02:36:58 +02:00
|
|
|
}
|
|
|
|
|
2011-04-11 22:06:03 +02:00
|
|
|
void UILabelSkin::draw(UIElement *element)
|
|
|
|
{
|
2011-04-11 23:11:22 +02:00
|
|
|
UIElementSkin::draw(element);
|
2011-04-11 22:06:03 +02:00
|
|
|
UILabel *label = static_cast<UILabel*>(element);
|
2011-05-12 00:16:11 +02:00
|
|
|
getFont()->renderText(label->getText(), label->getRect(), label->getAlign(), getFontColor());
|
2011-04-11 22:06:03 +02:00
|
|
|
}
|