修复控件树重建,修复hover状态不正确
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user