AText#
HTML-capable text container.

| Header: | #include <AUI/View/AText.h> |
| CMake: | aui_link(my_target PUBLIC aui::views) |
Detailed Description#
Used to display rich text or large texts.
Unlike ALabel, AText is optimized to store, render, word break large texts.
AText always prefers expanding in horizontal over vertical.
To perform word breaking, AText requires it's width to be fully defined (either by FixedSize, Expanding or MaxSize), otherwise it would require large minimum width to fit all its children in a single row. By default AText's Expanding is (1, 0) (grow in width, keep minimum height). This behaviour is similar to AScrollArea.
When placed inside an AScrollArea, an AText with Expanding set will fill the full viewport width and word-wrap
within it, as the scroll area guarantees the content is given at least the viewport size on the expanding axis.
|
Examples#
examples/ui/contacts/src/main.cpp
AUI Contacts — Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.
Vertical {
SpacerFixed(8_dp),
_new<ATextField>() && mSearchQuery,
SpacerFixed(8_dp),
AText::fromString(predefined::DISCLAIMER) AUI_OVERRIDE_STYLE { ATextAlign::CENTER },
SpacerFixed(8_dp),
experimental::Dynamic {
.content = AUI_REACT(mSearchQuery->empty() ? indexedList() : searchQueryList()),
},
Label { AUI_REACT("{} contact(s)"_format(mContactCount)) } AUI_LET {
examples/ui/backdrop/src/main.cpp
Backdrop — Backdrop effects demo.
Vertical::Expanding {
Centered {
Icon { ":logo.svg" } AUI_OVERRIDE_STYLE { FixedSize { 128_dp } },
} AUI_OVERRIDE_STYLE { FixedSize { 500_dp, {} } },
AText::fromString(
" — Eh bien, mon prince. Gênes et Lucques ne sont plus que des apanages, des "
"поместья, de la famille Buonaparte. Non, je vous préviens que si vous ne me dites pas "
"que nous avons la guerre, si vous vous permettez encore de pallier toutes les infamies, "
"toutes les atrocités de cet Antichrist (ma parole, j'y crois) — je ne vous connais "
"plus, vous n'êtes plus mon ami, vous n'êtes plus мой верный раб, comme vous dites 1. "
examples/ui/views/src/ExampleWindow.cpp
Views Example — All-in-one views building example.
});
addView(Horizontal {
_new<ADrawableView>(IDrawable::fromUrl(":img/logo.svg")) AUI_OVERRIDE_STYLE { FixedSize { 32_dp } },
AText::fromString("Building beautiful programs in pure C++ without chromium embedded framework") AUI_OVERRIDE_STYLE {
Expanding(1, 1),
},
Horizontal {} AUI_LET {
mAsync << AUI_THREADPOOL {
auto drawable = IDrawable::fromUrl(
Public Types#
ParsedFlags#
struct AText::ParsedFlags
Empty structure.