将 C++ 标准更新到 26 并改进资源清理
在构建配置中将 C++ 标准提高到 26,并在应用程序关闭之前添加资源清理消息。为了 UI 代码的一致性,对格式进行了细微的调整。
This commit is contained in:
@@ -47,11 +47,11 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
font_manager::instance().load_default_font();
|
||||
|
||||
auto name = mirage_style::get().name();
|
||||
auto version = mirage_style::get().version();
|
||||
auto author = mirage_style::get().author();
|
||||
auto description = mirage_style::get().description();
|
||||
auto license = mirage_style::get().license();
|
||||
const auto name = mirage_style::get().name();
|
||||
const auto version = mirage_style::get().version();
|
||||
const auto author = mirage_style::get().author();
|
||||
const auto description = mirage_style::get().description();
|
||||
const auto license = mirage_style::get().license();
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "name: " << name << "\n";
|
||||
@@ -65,76 +65,76 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
const auto& window = mwindow::create({ 800, 600 }, L"Hello, World!");
|
||||
window->set_content(
|
||||
mnew(mv_box)
|
||||
mnew(mv_box)
|
||||
[
|
||||
mslot(mv_box)
|
||||
.horizontal_alignment(horizontal_alignment_t::left)
|
||||
+ mnew(mbutton)
|
||||
[
|
||||
mslot(mv_box)
|
||||
.horizontal_alignment(horizontal_alignment_t::left)
|
||||
+ mnew(mbutton)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({ 10 })
|
||||
.visibility(visibility_t::visible)
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(config_info_str)
|
||||
.font_size(15)
|
||||
)
|
||||
]
|
||||
],
|
||||
mslot(mbutton)
|
||||
.margin({10})
|
||||
.visibility(visibility_t::visible)[
|
||||
mnew(mtext_block,
|
||||
.text(config_info_str)
|
||||
.font_size(15)
|
||||
)
|
||||
]
|
||||
],
|
||||
|
||||
mslot(mv_box)
|
||||
.horizontal_alignment(horizontal_alignment_t::right)
|
||||
+ mnew(mbutton)
|
||||
mslot(mv_box)
|
||||
.horizontal_alignment(horizontal_alignment_t::right)
|
||||
+ mnew(mbutton)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({10})
|
||||
.visibility(visibility_t::visible)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({ 10 })
|
||||
.visibility(visibility_t::visible)
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(U"Hello, World! 你好,世界!\n换行测试1111,测试测试测试测试,测试测试😀🐵🙏 😃🐵🙏")
|
||||
// .text(U"😀🐵🙏😀🐵🙏")
|
||||
.font_size(15)
|
||||
.warp_text(true)
|
||||
)
|
||||
]
|
||||
mnew(mtext_block,
|
||||
.text(U"Hello, World! 你好,世界!\n换行测试1111,测试测试测试测试,测试测试😀🐵🙏 😃🐵🙏")
|
||||
// .text(U"😀🐵🙏😀🐵🙏")
|
||||
.font_size(15)
|
||||
.warp_text(true)
|
||||
)
|
||||
]
|
||||
]
|
||||
);
|
||||
]
|
||||
);
|
||||
|
||||
const auto& window2 = mwindow::create({ 800, 600 }, L"Hello, World!");
|
||||
const auto& window2 = mwindow::create({800, 600}, L"Hello, World!");
|
||||
window2->set_content(
|
||||
mnew(moverlay)
|
||||
[
|
||||
mslot(moverlay)
|
||||
.h_alignment(horizontal_alignment_t::center)
|
||||
.v_alignment(vertical_alignment_t::center)
|
||||
+mnew(mbutton)
|
||||
+ mnew(mbutton)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({ 10 })
|
||||
.margin({10})
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(U"测试测试")
|
||||
.font_size(24))
|
||||
.text(U"测试测试")
|
||||
.font_size(24))
|
||||
]
|
||||
],
|
||||
|
||||
mslot(moverlay)
|
||||
.h_alignment(horizontal_alignment_t::center)
|
||||
.v_alignment(vertical_alignment_t::center)
|
||||
+mnew(mbutton)
|
||||
+ mnew(mbutton)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({ 10 })
|
||||
.margin({10})
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(U"测试测试21111")
|
||||
.font_size(15))
|
||||
.text(U"测试测试21111")
|
||||
.font_size(15))
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
mirage_app::get().run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user