34 using namespace std::literals;
35 std::vector<std::string> tab_values{
36 "Tab 1",
"Tab 2",
"Tab 3",
"A very very long tab",
"탭",
44 [&] {
return text(
"Frame count: " + std::to_string(frame_count++)); }));
48 container->Add(
Text(
"This demonstrate the Menu component"));
49 container->Add(
Menu(&tab_values, &tab_selected, option));
53 container->Add(
Text(
"Set underline color to blue"));
56 container->Add(
Menu(&tab_values, &tab_selected, option));
60 container->Add(
Text(
"Set underline active color to red"));
63 container->Add(
Menu(&tab_values, &tab_selected, option));
67 container->Add(
Text(
"Set animation duration to 0ms"));
69 option.underline.SetAnimationDuration(0ms);
70 container->Add(
Menu(&tab_values, &tab_selected, option));
74 container->Add(
Text(
"Set animation easing function to back-out"));
76 option.underline.SetAnimationFunction(animation::easing::BackOut);
77 option.underline.SetAnimationDuration(350ms);
78 container->Add(
Menu(&tab_values, &tab_selected, option));
83 container->Add(
Text(
"Add delay to desynchronize animation"));
85 option.underline.follower_delay = 250ms;
86 container->Add(
Menu(&tab_values, &tab_selected, option));
89 container->SetActiveChild(container->ChildAt(2));
92 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.