Skip to content

ass::Expanding#

Controls the expanding of AView.

Header:#include <AUI/ASS/Property/Expanding.h>
CMake:aui_link(my_target PUBLIC aui::views)

Examples#

examples/app/game_of_life/src/main.cpp

Game of Life - Game of Life implementation that uses advanced large dynamic data rendering techniques such as ITexture, AImage to be GPU friendly. The computation is performed in AThreadPool.

            },
          },
          Centered {
            _new<CellsView>(aui::ptr::fake_shared(&mCells)) AUI_WITH_STYLE {
                  Expanding(),
                  BackgroundSolid(AColor::BLACK),
                },
          },
        });
    }

examples/ui/backdrop/src/main.cpp

Backdrop - Backdrop effects demo.

static auto headerWithContents(_<AView> content) {
    auto result = Stacked {
        AScrollArea::Builder().withContents(content).build() AUI_WITH_STYLE {
              Expanding(),
              Padding { 80_dp, 0, 0 },
            } AUI_LET { it->setExtraStylesheet(
                     AStylesheet {
                         {
                             t<AScrollAreaViewport>(),

examples/ui/contacts/src/view/ContactDetailsView.cpp

AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.

    mOriginalContact = mContact;
    setExtraStylesheet(AStylesheet {
      {
        c(".row-value"),
        Expanding(1, 0),
      },
    });
    connect(mEditorMode, [this] {
        setContents(Vertical::Expanding {
          AScrollArea::Builder().withContents(Centered {

examples/7guis/crud/src/main.cpp

7GUIs CRUD - Create/Read/Update/Delete example.

                Label { "Filter prefix:" },
                _new<ATextField>() AUI_WITH_STYLE { Expanding(1, 0) } && mFilterPrefix,
              },
              AScrollArea::Builder().withExpanding().withContents(
                  AUI_DECLARATIVE_FOR(i, *mUsers | FILTER_VIEW, AVerticalLayout) {
                    auto view = _new<ALabel>();
                    view & i->displayName;
                    connect(mSelectedUser, view, [this, &view = *view, i] {
                        view.setAssName("selected", mSelectedUser == i);
                    });

examples/7guis/cells/src/main.cpp

7GUIs Cells - Spreadsheet processor (Excel).

                        }

                        views[0][0] = _new<AView>();   // blank
                        for (unsigned i = 0; i < mState->spreadsheet.size().x; ++i) {
                            views[0][i + 1] = Centered{ labelTitle(Cell::columnName(i)) } AUI_WITH_STYLE { Expanding(1, 0) };
                        }
                        for (unsigned row = 0; row < mState->spreadsheet.size().y; ++row) {
                            views[row + 1][0] = labelTitle("{}"_format(Cell::rowName(row)));
                            for (unsigned column = 0; column < mState->spreadsheet.size().x; ++column) {
                                views[row + 1][column + 1] = _new<CellView>(mState, mState->spreadsheet[{ column, row }]) AUI_WITH_STYLE {

examples/7guis/circle_drawer/src/main.cpp

7GUIs Circle Drawer - Undo, redo, dialog control.

class CircleDrawArea : public AView {
public:
    CircleDrawArea(_<State> state) : mState(std::move(state)) {
        setCustomStyle({
          Expanding(),
          BackgroundSolid(AColor::WHITE),
          Border(1_px, AColor::GRAY),
          AOverflow::HIDDEN_FROM_THIS,
        });
        connect(mState->circles.changed, me::redraw);