todo 垂直布局不正确
This commit is contained in:
@@ -18,14 +18,15 @@ int main(int argc, char* argv[]) {
|
||||
mirage_app::get_render_context()->setup_surface(window.get());
|
||||
widget_manager::get().init_window(window);
|
||||
|
||||
auto weak_border = widget_manager::get().new_widget<mborder>(window.get());
|
||||
auto weak_vbox = widget_manager::get().new_widget<mv_box>(window.get());
|
||||
auto vbox = weak_vbox.lock();
|
||||
|
||||
auto button = widget_manager::get().new_widget<mbutton>(window.get());
|
||||
vbox->add_slot<mbutton>().margin({ 5 });
|
||||
vbox->add_slot<mbutton>().margin({ 5 }).stretch(1);
|
||||
vbox->add_slot<mbutton>().margin({ 5 });
|
||||
vbox->add_slot<mbutton>().margin({ 5 });
|
||||
|
||||
auto border = weak_border.lock();
|
||||
border->set_content(button.lock()).margin({ 5 });
|
||||
|
||||
window->set_content(border);
|
||||
window->set_content(vbox);
|
||||
|
||||
app.run();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user