diff options
Diffstat (limited to 'src/ui/label.cc')
-rw-r--r-- | src/ui/label.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/label.cc b/src/ui/label.cc index 1b142c4..6f496fc 100644 --- a/src/ui/label.cc +++ b/src/ui/label.cc @@ -16,6 +16,7 @@ Label::Label(Widget *parent, const char *text) : Widget(parent) { set_label("label"); set_text(text); + set_alignment(AlignLeft | AlignTop); } Label::~Label() @@ -41,6 +42,11 @@ void Label::set_text(std::string const &text) label_text.assign(text); } +void Label::set_alignment(unsigned int alignment) +{ + label_alignment = alignment; +} + void Label::draw() { Widget::draw(); @@ -54,7 +60,7 @@ void Label::draw_text() return; paint::color(palette()->foreground()); - paint::text_centered(global_location(), size(), text(), font()); + paint::text(global_location(), size(), font(), text(), alignment()); } } |