overlay控件
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "widget/panel_widget/mbox.h"
|
||||
|
||||
#include "utf8.h"
|
||||
#include "widget/panel_widget/moverlay.h"
|
||||
|
||||
void test_color() {
|
||||
const char* test_cases[] = {
|
||||
@@ -77,7 +78,7 @@ int main(int argc, char* argv[]) {
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(config_info_str)
|
||||
.font_size(24)
|
||||
.font_size(15)
|
||||
)
|
||||
]
|
||||
],
|
||||
@@ -93,13 +94,47 @@ int main(int argc, char* argv[]) {
|
||||
mnew(mtext_block,
|
||||
.text(U"Hello, World! 你好,世界!\n换行测试1111,测试测试测试测试,测试测试😀🐵🙏 😃🐵🙏")
|
||||
// .text(U"😀🐵🙏😀🐵🙏")
|
||||
.font_size(24)
|
||||
)
|
||||
.font_size(15)
|
||||
)
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
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)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({ 10 })
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(U"测试测试")
|
||||
.font_size(24))
|
||||
]
|
||||
],
|
||||
|
||||
mslot(moverlay)
|
||||
.h_alignment(horizontal_alignment_t::center)
|
||||
.v_alignment(vertical_alignment_t::center)
|
||||
+mnew(mbutton)
|
||||
[
|
||||
mslot(mbutton)
|
||||
.margin({ 10 })
|
||||
[
|
||||
mnew(mtext_block,
|
||||
.text(U"测试测试21111")
|
||||
.font_size(15))
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
mirage_app::get().run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user