File tree Expand file tree Collapse file tree 2 files changed +61
-3
lines changed
src/ruis/widget/group/touch Expand file tree Collapse file tree 2 files changed +61
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2323
2424using namespace ruis ::touch;
2525
26+ list::list (utki::shared_ref<ruis::context> context, all_parameters params) :
27+ widget(
28+ std::move (context), //
29+ std::move(params.layout_params),
30+ std::move(params.widget_params)
31+ ),
32+ ruis::list(this ->context, std::move(params)),
33+ flickable(this ->context)
34+ {}
35+
2636ruis::event_status list::on_mouse_button (const mouse_button_event& event)
2737{
2838 return this ->flickable ::on_mouse_button (event);
Original file line number Diff line number Diff line change @@ -21,13 +21,61 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2121
2222#include " list_page.hpp"
2323
24+ #include < ruis/widget/group/touch/list.hpp>
25+ #include < ruis/widget/label/text.hpp>
26+
27+ #include " style.hpp"
28+
29+ using namespace std ::string_literals;
30+
31+ namespace {
32+ class list_page_provider : public ruis ::list_provider
33+ {
34+ public:
35+ list_page_provider (utki::shared_ref<ruis::context> context) :
36+ ruis::list_provider (std::move(context))
37+ {}
38+
39+ size_t count () const noexcept override
40+ {
41+ return 100 ;
42+ }
43+
44+ utki::shared_ref<ruis::widget> get_widget (size_t index) override
45+ {
46+ return m::text (this ->context , {}, U" Hello world!" s);
47+ }
48+ };
49+ } // namespace
50+
2451namespace {
25- class list_page : public ruis ::page
52+ class list_page :
53+ public ruis::page, //
54+ private ruis::touch::list
2655{
2756public:
2857 list_page (utki::shared_ref<ruis::context> c) :
29- ruis::widget (std::move(c), {}, {}),
30- ruis::page (this ->context, {})
58+ // clang-format off
59+ ruis::widget (std::move(c),
60+ {},
61+ {
62+ .clip = true
63+ }
64+ ),
65+ // clang-format on
66+ ruis::page (this ->context, {}),
67+ // clang-format off
68+ ruis::touch::list (this ->context,
69+ {
70+ .oriented_params {
71+ .vertical = true
72+ },
73+ .list_params {
74+ .provider = utki::make_shared<list_page_provider>(this ->context )
75+ }
76+ }
77+ )
78+ // clang-format on
3179 {}
3280};
3381
You can’t perform that action at this time.
0 commit comments