vkdoom_m/include/zwidget/widgets/textlabel/textlabel.h
Marisa the Magician 991d522c57 Squashed 'libraries/ZWidget/' changes from b5ae8c8ab0..bac2a2edc5
bac2a2edc5 Exclude SDL2 from Windows compilation.
5b859bfd84 WaylandDisplayBackend: If the clicked window has a locked mouse, hide the cursor afterwards
ce76df6aa6 WaylandDisplayBackend: Add a TODO about XDG_Activation
a0ba04275b WaylandDisplayWindow: Move XDG Activation Token outside activate()

git-subtree-dir: libraries/ZWidget
git-subtree-split: bac2a2edc52cf12d1223244251876e9c4533e614
2025-09-24 19:42:37 +02:00

33 lines
584 B
C++

#pragma once
#include "../../core/widget.h"
enum class TextLabelAlignment
{
Left,
Center,
Right
};
class TextLabel : public Widget
{
public:
TextLabel(Widget* parent = nullptr);
void SetText(const std::string& value);
const std::string& GetText() const;
void SetTextAlignment(TextLabelAlignment alignment);
TextLabelAlignment GetTextAlignment() const;
double GetPreferredWidth() const;
double GetPreferredHeight() const;
protected:
void OnPaint(Canvas* canvas) override;
private:
std::string text;
TextLabelAlignment textAlignment = TextLabelAlignment::Left;
};