-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext_area.cpp
30 lines (24 loc) · 891 Bytes
/
text_area.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "example.h"
#include <rad/ui/layout.h>
#include <rad/ui/material3/textfield.h>
#include <rad/ui/material3/checkbox.h>
using namespace rad;
using namespace ui;
struct TextAreaPage : public VerticalBox {
material::TextField text_field;
material::CheckBox outlined_check;
TextAreaPage() {
text_field.label_text() = "Text Area";
text_field.placeholder_text() = "Type something here !";
text_field.supporting_text() = "This is a multiline text area";
text_field.max_chars_count() = 5000;
text_field.single_line() = false;
text_field.type = if_else(outlined_check.selected, material::TextFieldType::outlined, material::TextFieldType::filled);
outlined_check.text() = "outlined";
add_child(text_field);
add_child(outlined_check);
}
};
std::unique_ptr<Item> demo::make_text_area_page() {
return std::make_unique<TextAreaPage>();
}