35 using namespace std::literals;
36 std::vector<std::string> tab_values{
37 "Tab 1",
"Tab 2",
"Tab 3",
"A very very long tab",
"탭",
45 [&] {
return text(
"Frame count: " + std::to_string(frame_count++)); }));
49 container->Add(
Text(
"This demonstrate the Menu component"));
50 container->Add(
Menu(&tab_values, &tab_selected, option));
54 container->Add(
Text(
"Set underline color to blue"));
57 container->Add(
Menu(&tab_values, &tab_selected, option));
61 container->Add(
Text(
"Set underline active color to red"));
64 container->Add(
Menu(&tab_values, &tab_selected, option));
68 container->Add(
Text(
"Set animation duration to 0ms"));
70 option.underline.SetAnimationDuration(0ms);
71 container->Add(
Menu(&tab_values, &tab_selected, option));
75 container->Add(
Text(
"Set animation easing function to back-out"));
77 option.underline.SetAnimationFunction(animation::easing::BackOut);
78 option.underline.SetAnimationDuration(350ms);
79 container->Add(
Menu(&tab_values, &tab_selected, option));
84 container->Add(
Text(
"Add delay to desynchronize animation"));
86 option.underline.follower_delay = 250ms;
87 container->Add(
Menu(&tab_values, &tab_selected, option));
90 container->SetActiveChild(container->ChildAt(2));
93 screen.Loop(container);
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.