summaryrefslogtreecommitdiff
path: root/src/guichan
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-14 18:50:27 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-14 18:50:27 +0300
commit066488a6f4d086b57f4fe32e8799c207552cccb7 (patch)
tree2c73d80030ff0da73fc5f5b4b664a34030a51633 /src/guichan
parent0b3aafe2859d9ea1c4009eed8a87f69c41cbc14b (diff)
downloadmanaverse-066488a6f4d086b57f4fe32e8799c207552cccb7.tar.gz
manaverse-066488a6f4d086b57f4fe32e8799c207552cccb7.tar.bz2
manaverse-066488a6f4d086b57f4fe32e8799c207552cccb7.tar.xz
manaverse-066488a6f4d086b57f4fe32e8799c207552cccb7.zip
Add theming to labels.
New theme file: label.xml Parameters: padding
Diffstat (limited to 'src/guichan')
-rw-r--r--src/guichan/widgets/label.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/guichan/widgets/label.cpp b/src/guichan/widgets/label.cpp
index cfd62630a..dc88deb69 100644
--- a/src/guichan/widgets/label.cpp
+++ b/src/guichan/widgets/label.cpp
@@ -93,32 +93,9 @@ namespace gcn
void Label::draw(Graphics* graphics)
{
- int textX;
- const int textY = getHeight() / 2 - getFont()->getHeight() / 2;
-
- switch (getAlignment())
- {
- case Graphics::LEFT:
- textX = 0;
- break;
- case Graphics::CENTER:
- textX = getWidth() / 2;
- break;
- case Graphics::RIGHT:
- textX = getWidth();
- break;
- default:
- throw GCN_EXCEPTION("Unknown alignment.");
- }
-
- graphics->setFont(getFont());
- graphics->setColor(mForegroundColor);
- graphics->drawText(getCaption(), textX, textY, getAlignment());
}
void Label::adjustSize()
{
- setWidth(getFont()->getWidth(getCaption()));
- setHeight(getFont()->getHeight());
}
}