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/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),
                },
          },
        } AUI_WITH_STYLE { LayoutSpacing { 4_dp } });
    }

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/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 } };
}

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_WITH_STYLE { Padding { 50_dp } },
        },
    };

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>;
};

auto dateTextField(_<DateTextFieldState> state) {
    return _new<ATextField>() AUI_LET {

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/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_WITH_STYLE {
                                    BackgroundSolid { AColor::WHITE },
                                    MinSize { {}, 20_dp },
                                };
                            }
                        }
                        return views;