19 auto option = ButtonOption::Animated();
20 option.transform = [](
const EntryState& s) {
43 auto buttons = Container::Vertical({
44 Container::Horizontal({btn_dec_01, btn_inc_01}, &row) | flex,
45 Container::Horizontal({btn_dec_10, btn_inc_10}, &row) | flex,
49 auto component =
Renderer(buttons, [&] {
53 buttons->Render() |
flex,
58 auto screen = App::FitComponent();
59 screen.Loop(component);
Component Button(ConstStringRef label, std::function< void()> on_click, ButtonOption options=ButtonOption::Simple())
繪製一個按鈕。點擊時執行一個函式。
Component Renderer(Component child, std::function< Element()>)
回傳一個新的 Component,類似 |child|,但使用 |render| 作為 Component::Render() 事件。
Element text(std::string_view text)
顯示一段 UTF8 編碼的 Unicode 文字。
Element flex(Element child)
讓子元素依比例擴展以填滿容器中剩餘的空間。
Element bold(Element child)
使用粗體字型,用於需要更多強調的元素。
Element separator()
在兩個元素之間繪製垂直或水平分隔線。
Element vbox(Elements children)
一個垂直一個接一個顯示元素的容器。