Skip to content

ass::BackgroundSolid#

Represents solid (single color) background.

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

Examples#

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

7GUIs Flight Booker — Flight Booker.

//     using type = _<ass::prop::IPropertyBase>;
// };

template<>
struct std::common_type<ass::BackgroundSolid, std::nullptr_t> {
    using type = _<ass::prop::IPropertyBase>;
};

/// [date_field]
auto dateTextField(_<DateTextFieldState> state) {
examples/7guis/cells/src/main.cpp

7GUIs Cells — Spreadsheet processor (Excel).

                        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_OVERRIDE_STYLE {
                                    BackgroundSolid { AColor::WHITE },
                                    MinSize { {}, 20_dp },
                                };
                            }
                        }
                        return views;
examples/7guis/circle_drawer/src/main.cpp

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

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);
        connect(mHoveredCircle.changed, me::redraw);
examples/7guis/crud/src/main.cpp

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

    CRUDWindow(): AWindow("AUI - 7GUIs - CRUD", 300_dp, 200_dp) {
        setExtraStylesheet(AStylesheet {
          {
            c("selected"),
            BackgroundSolid { AColor::BLUE.transparentize(0.5f) },
          }
        });

        auto FILTER_VIEW = ranges::views::filter([this](const _<User>& user) {
            return user->displayName->startsWith(*mFilterPrefix);
examples/app/minesweeper/src/Style.cpp

Minesweeper Game — Minesweeper game implementation driven by ass.

        AStylesheet::global().addRules({
          {
            t<CellView>(),
            FixedSize { 26_dp },
            BackgroundSolid { 0xdedede_rgb },
            Border { 1_px, 0xeaeaea_rgb },
          },
          {
            !RevealSelector{} >> t<CellView>::hover(),
            BackgroundSolid { 0xfdfdfd_rgb },
examples/app/fractal/src/FractalWindow.cpp

Fractal Example — Fractal viewer application demonstrating usage of custom shaders.

    auto centerPosDisplay = _new<ALabel>("-");
    {
        centerPosDisplay->setCustomStyle({
          BackgroundSolid { 0x80000000_argb },
          Padding { 4_dp },
          TextColor { 0xffffff_rgb },
          FontSize { 11_pt },
        });
    }
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_OVERRIDE_STYLE {
                  Expanding(),
                  BackgroundSolid(AColor::BLACK),
                },
          },
        } AUI_OVERRIDE_STYLE { LayoutSpacing { 4_dp } });
    }
examples/app/notes/src/main.cpp

Notes App — Note taking app that demonstrates usage of AListModel, AProperty, user data saving and loading.

    MainWindow() : AWindow("Notes") {
        setExtraStylesheet(AStylesheet {
          {
            c(".plain_bg"),
            BackgroundSolid { AColor::WHITE },
          },
          {
            t<AWindow>(),
            Padding { 0 },
          },
examples/ui/contacts/src/main.cpp

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

                      .build() AUI_OVERRIDE_STYLE { Expanding(0, 1), MinSize(200_dp) },

              experimental::Dynamic {
                  .content = AUI_REACT(mSelectedContact != nullptr ? contactDetails(mSelectedContact) : nullptr),
              } AUI_OVERRIDE_STYLE { Expanding(), MinSize(300_dp), BackgroundSolid { AColor::WHITE } },
            } AUI_OVERRIDE_STYLE {
              Padding(0),
            });
    }
examples/ui/backdrop/src/main.cpp

Backdrop — Backdrop effects demo.

                          Backdrop::GaussianBlur { 5_dp },
                      },
//                      Border { 1_dp, AColor::GRAY.transparentize(0.6f) },
                      BoxShadow { 0, 32_dp, 32_dp, AColor::BLACK.transparentize(0.8f) },
                      BackgroundSolid { AColor::WHITE.transparentize(0.5f) },
                  },
              }
          } AUI_OVERRIDE_STYLE { Padding { 50_dp } },
        },
    };
examples/ui/opengl_simple/src/main.cpp

OpenGL Example — Demonstrates how to integrate custom OpenGL rendering with AUI Framework.

              Vertical {
                Label { AUI_REACT(fmt::format("FPS: {:.1f}", *state->fps)) },
              } AUI_OVERRIDE_STYLE {
                    Padding(16_dp),
                    BackgroundSolid { AColor::WHITE.transparentize(0.5f) },
                    MinSize { 150_dp, {} },
                  },
            },
          },
        } AUI_OVERRIDE_STYLE { Padding(0) });
examples/ui/views/src/ExampleWindow.cpp

Views Example — All-in-one views building example.

                                  _new<ALabel>(i.toString()) AUI_OVERRIDE_STYLE {
                                      TextColor { i.readableBlackOrWhite() },
                                  }
                              } AUI_OVERRIDE_STYLE {
                                  BackgroundSolid { i },
                                  BorderRadius { 6_pt },
                                  Margin { 2_dp, 4_dp },
                              };
                          }
                      };
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_OVERRIDE_STYLE { FixedSize { {}, 1_px }, BackgroundSolid { AColor::GRAY } };
}