ass::FixedSize#
Controls the fixed size of AView.
| Header: | #include <AUI/ASS/Property/FixedSize.h> |
| CMake: | aui_link(my_target PUBLIC aui::views) |
Examples#
examples/app/minesweeper/src/Style.cpp
Minesweeper Game - Minesweeper game implementation driven by ass.
examples/ui/minimal_ui_assets_xmake/src/MainWindow.cpp
Minimal UI Template XMake with Assets - Minimal UI boilerplate template XMake with AUI Assets.
MainWindow::MainWindow(): AWindow("Project template app", 300_dp, 200_dp) {
setContents(
Centered{
Vertical{
Centered { Icon { ":img/logo.svg" } with_style { FixedSize(64_dp) } },
Centered { Label { "Hello world from AUI!" } },
_new<AButton>("Visit GitHub repo").connect(&AView::clicked, this, [] {
APlatform::openUrl("https://github.com/aui-framework/aui");
}),
_new<AButton>("Visit docs").connect(&AView::clicked, this, [] {
examples/ui/contacts/src/view/ContactDetailsView.cpp
AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.
Label {
AUI_REACT(contact->displayName->empty() ? "?" : AString(1, contact->displayName->first()).uppercase())
} AUI_WITH_STYLE { Opacity(0.5f), FontSize { 32_dp } },
} AUI_WITH_STYLE {
FixedSize { 64_dp },
BorderRadius { 32_dp },
BackgroundGradient { AColor::GRAY.lighter(0.5f), AColor::GRAY, 163_deg },
};
}
examples/ui/backdrop/src/main.cpp
Backdrop - Backdrop effects demo.
Vertical::Expanding {
Centered {
Horizontal {
Label { "boll" } AUI_WITH_STYLE {
FixedSize { 60_dp },
BorderRadius { 60_dp / 2.f },
Padding { 0 },
ATextAlign::CENTER,
Backdrop {
Backdrop::LiquidFluid {},
examples/ui/contacts/src/view/common.cpp
AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.
using namespace ass;
using namespace declarative;
_<AView> common_views::divider() {
return _new<AView>() AUI_WITH_STYLE { FixedSize { {}, 1_px }, BackgroundSolid { AColor::GRAY } };
}