@@ -22,7 +22,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2222#include " list_page.hpp"
2323
2424#include < ruis/widget/group/touch/list.hpp>
25+ #include < ruis/widget/label/gap.hpp>
26+ #include < ruis/widget/label/padding.hpp>
2527#include < ruis/widget/label/text.hpp>
28+ #include < utki/string.hpp>
29+ #include < utki/unicode.hpp>
2630
2731#include " style.hpp"
2832
@@ -43,7 +47,65 @@ class list_page_provider : public ruis::list_provider
4347
4448 utki::shared_ref<ruis::widget> get_widget (size_t index) override
4549 {
46- return m::text (this ->context , {}, U" Hello world!" s);
50+ // clang-format off
51+ auto button = m::push_button (this ->context ,
52+ {
53+ .layout_params {
54+ .dims = {ruis::dim::min, ruis::length::make_pp (30 )}
55+ }
56+ },
57+ {
58+ m::text (this ->context , {}, U" Button" s)
59+ }
60+ );
61+ // clang-format on
62+
63+ button.get ().click_handler = [index](auto & btn) {
64+ std::cout << " Item #" << index << " button cliecked" << std::endl;
65+ };
66+
67+ // clang-format off
68+ return m::column (this ->context ,
69+ {
70+ .layout_params {
71+ .dims = {ruis::dim::fill, ruis::dim::min}
72+ }
73+ },
74+ {
75+ m::padding (this ->context ,
76+ {
77+ .container_params {
78+ .layout = ruis::layout::row
79+ },
80+ .padding_params {
81+ .borders = {ruis::length::make_pp (3 )}
82+ }
83+ },
84+ {
85+ m::text (this ->context , {}, utki::to_utf32 (utki::cat (" Item #" , index))),
86+ m::gap (this ->context ,
87+ {
88+ .layout_params {
89+ .dims = {ruis::length::make_pp (5 ), ruis::dim::min}
90+ }
91+ }
92+ ),
93+ std::move (button)
94+ }
95+ ),
96+ m::gap (this ->context ,
97+ {
98+ .layout_params {
99+ .dims = {ruis::dim::fill, ruis::length::make_pp (1 )}
100+ },
101+ .color_params {
102+ .color = 0xff808080
103+ }
104+ }
105+ )
106+ }
107+ );
108+ // clang-format on
47109 }
48110};
49111} // namespace
0 commit comments