Add {Const,}StringRef to simplify components.

This commit is contained in:
ArthurSonzogni
2021-05-14 21:43:35 +02:00
parent 9fdf235836
commit 048efb6912
29 changed files with 201 additions and 164 deletions

View File

@@ -30,7 +30,7 @@ namespace ftxui {
/// ```bash
/// ☐ Make a sandwitch
/// ```
Component Checkbox(const std::wstring* label, bool* checked) {
Component Checkbox(ConstStringRef label, bool* checked) {
return Make<CheckboxBase>(label, checked);
}
@@ -39,7 +39,7 @@ CheckboxBase* From(Component component) {
return static_cast<CheckboxBase*>(component.get());
}
CheckboxBase::CheckboxBase(const std::wstring* label, bool* state)
CheckboxBase::CheckboxBase(ConstStringRef label, bool* state)
: label_(label), state_(state) {}
Element CheckboxBase::Render() {