|
4 | 4 | #include <ruis/render/renderer.hpp> |
5 | 5 | #include <ruis/widget/button/push_button.hpp> |
6 | 6 | #include <ruis/widget/group/book.hpp> |
| 7 | +#include <ruis/widget/label/text.hpp> |
| 8 | +#include <ruis/widget/label/gap.hpp> |
7 | 9 |
|
8 | 10 | #include "cube_page.hpp" |
9 | 11 |
|
| 12 | +using namespace std::string_literals; |
| 13 | + |
| 14 | +namespace m{ |
| 15 | + using namespace ruis::make; |
| 16 | +} |
| 17 | + |
10 | 18 | namespace{ |
11 | 19 |
|
12 | 20 | class cube_widget : public ruis::widget, public ruis::updateable{ |
@@ -103,27 +111,57 @@ class cube_widget : public ruis::widget, public ruis::updateable{ |
103 | 111 | } |
104 | 112 |
|
105 | 113 | cube_page::cube_page(utki::shared_ref<ruis::context> c) : |
106 | | - widget(std::move(c), tml::forest()), |
107 | | - page(this->context, tml::forest()), |
108 | | - container(this->context, tml::read(R"qwertyuiop( |
109 | | - layout{pile} |
110 | | - @column{ |
111 | | - lp{ |
112 | | - dx{fill}dy{fill} |
113 | | - } |
114 | | - @widget{ |
115 | | - id{placeholder} |
116 | | - lp{dx{fill}dy{fill}weight{1}} |
| 114 | + // clang-format off |
| 115 | + widget( |
| 116 | + std::move(c), |
| 117 | + { |
| 118 | + .dims = {ruis::dim::fill, ruis::dim::fill} |
| 119 | + }, |
| 120 | + {} |
| 121 | + ), |
| 122 | + page( |
| 123 | + this->context, |
| 124 | + ruis::widget::parameters{} |
| 125 | + ), |
| 126 | + container( |
| 127 | + this->context, |
| 128 | + ruis::container::all_parameters{ |
| 129 | + .container_params{ |
| 130 | + .layout = ruis::layout::column |
| 131 | + } |
| 132 | + }, |
| 133 | + { |
| 134 | + m::gap(this->context, |
| 135 | + { |
| 136 | + .layout_params{ |
| 137 | + .dims = {ruis::dim::fill, ruis::dim::fill}, |
| 138 | + .weight = 1 |
| 139 | + }, |
| 140 | + .widget_params{ |
| 141 | + .id = "placeholder" |
| 142 | + } |
117 | 143 | } |
118 | | - @text{text{"cube page"}} |
119 | | - @push_button{ |
120 | | - id{back_button} |
121 | | - @text{ |
122 | | - text{back} |
| 144 | + ), |
| 145 | + m::text(this->context, |
| 146 | + {}, |
| 147 | + U"cube page"s |
| 148 | + ), |
| 149 | + m::push_button(this->context, |
| 150 | + { |
| 151 | + .widget_params{ |
| 152 | + .id = "back_button"s |
123 | 153 | } |
| 154 | + }, |
| 155 | + { |
| 156 | + m::text(this->context, |
| 157 | + {}, |
| 158 | + U"back"s |
| 159 | + ) |
124 | 160 | } |
125 | | - } |
126 | | - )qwertyuiop")) |
| 161 | + ) |
| 162 | + } |
| 163 | + ) |
| 164 | + // clang-format on |
127 | 165 | { |
128 | 166 | auto& ph = this->get_widget("placeholder"); |
129 | 167 |
|
|
0 commit comments