2025-10-15 16:33:24 +03:00
|
|
|
#pragma once
|
|
|
|
|
#include "Element.hpp"
|
2026-04-07 22:21:06 +03:00
|
|
|
#include "../../RichText/TextBox.hpp"
|
2025-10-15 16:33:24 +03:00
|
|
|
|
|
|
|
|
namespace GUIStuff {
|
|
|
|
|
|
|
|
|
|
class TextParagraph : public Element {
|
|
|
|
|
public:
|
2026-04-07 22:21:06 +03:00
|
|
|
struct Data {
|
|
|
|
|
RichText::TextData text;
|
2026-04-25 19:01:19 +03:00
|
|
|
float maxGrowX = 10000.0f;
|
|
|
|
|
float maxGrowY = 0.0f;
|
|
|
|
|
bool ellipsis = true;
|
|
|
|
|
bool allowNewlines = true;
|
2026-04-07 22:21:06 +03:00
|
|
|
bool operator==(const Data& d) const = default;
|
|
|
|
|
bool operator!=(const Data& d) const = default;
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-27 09:51:53 +03:00
|
|
|
TextParagraph(GUIManager& gui);
|
2026-04-07 22:21:06 +03:00
|
|
|
void layout(const Clay_ElementId& id, const Data& newData);
|
2026-03-20 20:53:59 +03:00
|
|
|
virtual void clay_draw(SkCanvas* canvas, UpdateInputData& io, Clay_RenderCommand* command, bool skiaAA) override;
|
2025-10-15 16:33:24 +03:00
|
|
|
private:
|
2026-04-07 22:21:06 +03:00
|
|
|
Data d;
|
2026-04-25 19:01:19 +03:00
|
|
|
float fontSize;
|
2026-04-07 22:21:06 +03:00
|
|
|
std::unique_ptr<RichText::TextBox> textbox;
|
2025-10-15 16:33:24 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|