ass::on_state::Activated#
Activated LESS-style subselector.
| Header: | #include <AUI/ASS/Selector/on_state.h> |
| CMake: | aui_link(my_target PUBLIC aui::views) |
Detailed Description#
It's convenient to use it with AUI_OVERRIDE_STYLE:
_new<AView>() AUI_OVERRIDE_STYLE {
MinSize { 16_dp },
BackgroundSolid { AColor::BLACK },
on_state::Activated {
BackgroundSolid { AColor::RED },
},
},
Examples#
examples/ui/views/src/ExampleWindow.cpp
Views Example — All-in-one views building example.
} AUI_OVERRIDE_STYLE { LayoutSpacing { 4_dp } },
// [audio_ass_sound]
Vertical {
_new<AButton>("Button produces sound when clicked") AUI_OVERRIDE_STYLE {
ass::on_state::Activated {
ass::Sound { IAudioPlayer::fromUrl(":sound/click.ogg") },
},
},
} AUI_OVERRIDE_STYLE { LayoutSpacing { 4_dp } },
// [audio_ass_sound]