Skip to content

ass::Margin#

Controls view's margins.

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

Detailed Description#

See AUI Box Model.

Examples#

examples/app/minesweeper/src/Style.cpp

Minesweeper Game - Minesweeper game implementation driven by ass.

          {
            class_of(".frame"),
            Border { 1_dp, 0x444444_rgb },
          },
          { class_of(".frame") > t<AButton>(), Margin { 4_dp } },
          { t<NewGameWindow>(), Padding { 4_dp } },
        });
    }
} s;

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

7GUIs Cells - Spreadsheet processor (Excel).

        ALayoutInflater::inflate(
            this,
            _new<ATextField>() AUI_WITH_STYLE {
                  MinSize { 0 },
                  Margin { 0 },
                  BorderRadius { 0 },
                } AUI_LET {
                    it && mState->currentExpression;
                    it->focus();
                    connect(it->focusLost, me::commitExpression);

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

7GUIs Temperature Converter - Fahrenheit to Celsius and vice versa.

                biConnect(it->value(), mCelsius);
                it->focus();
            },
            Label { "°C" },
            Label { "=" } AUI_WITH_STYLE { Margin { {}, 16_dp } },
            myPicker() AUI_LET { biConnect(it->value(), mFahrenheit); },
            Label { "°F" },
          } AUI_WITH_STYLE { LayoutSpacing { 4_dp } },
        });

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

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

                profilePhoto(mContact),
                Centered::Expanding {
                  presentation(mContact->displayName) AUI_WITH_STYLE { FontSize { 12_pt } },
                },
              } AUI_WITH_STYLE { Margin { 8_dp, {} }, LayoutSpacing { 4_dp } },
              row("Phone", mContact->phone),
              row("Address", mContact->address),
              row("Email", mContact->email),
              row("Homepage", mContact->homepage),
              Horizontal::Expanding {