Skip to content

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.

AText::fromItems(
    { "These settings are applicable for render-to-texture optimizations.",
      makeLink("Learn more", "https://aui-framework.github.io/develop/md_docs_Render_to_texture.html") }),
CheckBoxWrapper { Label { "Highlight redraw requests" } } &&
    targetWindow->profiling()->highlightRedrawRequests,
AText::fromItems(
    { "Draws purple rect ", coloredRect(0xff00ff_rgb),
      " over view that requested redraw "
      "(AView::redraw). This can help to find views that causes window to repaint which "
      "affects application performance and device's battery life." }),
CheckBoxWrapper { Label { "Render to texture decay" } } && targetWindow->profiling()->renderToTextureDecay,
AText::fromItems(
    { "Visually displays render to texture optimization by gradually transforming old pixel ",
      "data to gray ", coloredRect(AColor::GRAY),
      " color. When a view is redrawn it pixel "
      "data would be represented as unaffected to gray color and seem bright and saturated "
      "color. From perspective of performance it's good that whole screen transformed to gray "
      "color and thus no redraw is performed." }),
CheckBoxWrapper { Label { "Breakpoint on AWindow update layout flag" } } &&
    targetWindow->profiling()->breakpointOnMarkMinContentSizeInvalid,
AText::fromItems(
    { "Stops the attached debugger at the point when window's update layout flag is set. This "
      "can be used to walk through stacktrace and find which view and why triggered layout "
      "update. When breakpoint is triggered, checkbox is unset. Note: when debugger is not attached, "
      "behaviour is undefined." }),

Examples#

examples/ui/backdrop/src/main.cpp

Backdrop - Backdrop effects demo.

          Vertical::Expanding {
            Centered {
              Icon { ":logo.svg" } AUI_WITH_STYLE { FixedSize { 128_dp } },
            } AUI_WITH_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. "

Public Types#

ParsedFlags#


struct AText::ParsedFlags

Empty structure.