Skip to content

Commit 27d36fe

Browse files
committed
stuff
1 parent 581e261 commit 27d36fe

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

tests/app2/src/table_list_window.cpp

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,32 @@ using namespace ruis::length_literals;
1313

1414
namespace m = ruis::make;
1515

16+
namespace {
17+
const tml::forest list_data = tml::read(R"qwertyuiop(
18+
""{"row 0" "0123" "321sadf0"}
19+
""{"row 1" "12345" "54321asdfas"}
20+
""{"row 2" "2345" "54321asdf"}
21+
""{"row 3" "3452434" "5432sdfas1"}
22+
""{"row 4" "4512124" "5432asdf1"}
23+
""{"row 5" "54123" "5432dff1"}
24+
""{"row 6" "6 324123" "54asdf321"}
25+
""{"row 7" "7 546 45" "543sdafas21"}
26+
""{"row 8" "8 3453" "5432asdf1"}
27+
""{"row 9" "9 3453245" "543asdf21"}
28+
""{"row 10" "10 345222345" "543gfgsdf21"}
29+
""{"row 11" "11 35432345" "5432sgdfgsdfgs1"}
30+
""{"row 12" "12 35324345" "sdfgsdfg54321"}
31+
""{"row 13" "13 35432445" "5432sdfg1"}
32+
""{"row 14" "14 345 345" "5432gsfd1"}
33+
""{"row 15" "15 3 45234" "543sdsdf21"}
34+
""{"row 16" "16 543345" "5432gsdf1"}
35+
""{"row 17" "17 5234 23534" "5432dfg1"}
36+
""{"row 18" "18 4534 5324" "543dfg21"}
37+
""{"row 19" "19 3453 45 " "5432sgdfsdfg1"}
38+
""{"row 20" "20 45 2345 342" "543sdfg21"}
39+
)qwertyuiop");
40+
} // namespace
41+
1642
namespace {
1743
utki::shared_ref<ruis::widget> make_table_list_header(
1844
const utki::shared_ref<ruis::context>& c, //
@@ -88,15 +114,22 @@ utki::shared_ref<ruis::widget> make_table_list_window(
88114
{}
89115

90116
size_t count() const noexcept override{
91-
return 1;
117+
return list_data.size();
92118
}
93119

94120
ruis::widget_list get_row_widgets(size_t index) override{
95-
return {
96-
m::text(this->context, {}, U"Hi!"s),
97-
m::text(this->context, {.widget_params{.clip = true}}, U"How are you?"s),
98-
m::text(this->context, {}, U"Fine!"s)
99-
};
121+
ruis::widget_list ret;
122+
123+
for(auto i = 0; i != 3; ++i){
124+
ret.emplace_back(
125+
m::text(
126+
this->context,//
127+
{.widget_params{.clip = true}},
128+
utki::to_utf32(list_data[index].children[i].value.string)
129+
)
130+
);
131+
}
132+
return ret;
100133
}
101134
};
102135
return utki::make_shared<provider>(c);

0 commit comments

Comments
 (0)