From 066488a6f4d086b57f4fe32e8799c207552cccb7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 14 Oct 2012 18:50:27 +0300 Subject: Add theming to labels. New theme file: label.xml Parameters: padding --- src/guichan/widgets/label.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/guichan/widgets') 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()); } } -- cgit v1.2.3-70-g09d2