Implement GlStack, GlFlex is now child of GlStack

This commit is contained in:
Corentin 2021-07-22 17:47:03 +09:00
commit 896f98476e
12 changed files with 179 additions and 55 deletions

View file

@ -31,14 +31,30 @@ int main()
label->set_background_color(0.5f, 0.5f, 0.1f);
label = window->create_label(0.75f, 0.75f, "Hello World!", {1.0f, 1.0f, 1.0f, 0.1f});
auto stack = window->create_flex(200, 0.6f, uui::Direction::HORIZONTAL);
auto flex = window->create_flex(200, 0.6f, uui::Direction::HORIZONTAL);
comp = flex->create_component(100, 50);
comp->set_background_color(0.2f, 0.75f, 0.25f);
flex->create_label("test", {0.8f, 0.2f, 0.2f, 1.0f});
comp = flex->create_component(100, 20);
comp->set_background_color(0.2f, 0.25f, 0.75f);
flex = window->create_flex(50, 400, uui::Direction::VERTICAL);
comp = flex->create_component(50, 100);
comp->set_background_color(0.2f, 0.75f, 0.25f);
flex->create_label("test", {0.8f, 0.2f, 0.2f, 1.0f});
comp = flex->create_component(100, 20);
comp->set_background_color(0.2f, 0.25f, 0.75f);
window = app.create_window(800, 600, "OpenGl 2");
auto stack = window->create_stack(200, 0.6f, uui::Direction::HORIZONTAL);
comp = stack->create_component(100, 50);
comp->set_background_color(0.2f, 0.75f, 0.25f);
stack->create_label("test", {0.8f, 0.2f, 0.2f, 1.0f});
comp = stack->create_component(100, 20);
comp->set_background_color(0.2f, 0.25f, 0.75f);
stack = window->create_flex(50, 400, uui::Direction::VERTICAL);
stack = window->create_stack(50, 400, uui::Direction::VERTICAL);
comp = stack->create_component(50, 100);
comp->set_background_color(0.2f, 0.75f, 0.25f);
stack->create_label("test", {0.8f, 0.2f, 0.2f, 1.0f});