diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-11-29 21:30:22 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-11-29 21:30:22 +0100 |
commit | 25adc2eeda98d56c641ea6c33c019740fd332f98 (patch) | |
tree | e77f020515e413ecfc3e2bb18970bb2d6d3826e7 /plugingui/label.h | |
parent | 2aeb2c9cf4da7ded3f68c046f6fa2773dded44a8 (diff) |
Add text alignment and one-time autosize to Label.
Diffstat (limited to 'plugingui/label.h')
-rw-r--r-- | plugingui/label.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugingui/label.h b/plugingui/label.h index 3f0b93f..794778d 100644 --- a/plugingui/label.h +++ b/plugingui/label.h @@ -34,11 +34,21 @@ namespace GUI { +enum class TextAlignment { + left, + center, + right, +}; + class Label : public Widget { public: Label(Widget *parent); - void setText(std::string text); + void setText(const std::string& text); + + void setAlignment(TextAlignment alignment); + + void resizeToText(); protected: // From Widget: @@ -47,7 +57,8 @@ protected: private: std::string _text; Font font{":fontemboss.png"}; - + TextAlignment alignment{TextAlignment::left}; + int border{0}; }; } // GUI:: |