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
33 lines
584 B
C++
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;
|
|
};
|