修复控件树重建,修复hover状态不正确

This commit is contained in:
2025-03-24 01:43:01 +08:00
parent d650fcb558
commit 17c14a7a14
10 changed files with 51 additions and 21 deletions

View File

@@ -16,18 +16,17 @@ int main(int argc, char* argv[]) {
window->show();
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 border = weak_border.lock();
auto button = widget_manager::get().new_widget<mbutton>(window.get());
border->set_content(button.lock())
.margin({5});
auto border = weak_border.lock();
border->set_content(button.lock()).margin({ 5 });
window->set_content(border);
app.run();
return 0;
}