Improve add_child and Button APIs

This commit is contained in:
Luke Street
2026-04-30 23:36:30 -06:00
parent 39298f8d8f
commit e0c449f28e
9 changed files with 551 additions and 275 deletions
+2 -3
View File
@@ -45,13 +45,12 @@ void TabBar::add_tab(const Rml::String& title, TabCallback callback) {
}
mTabs.emplace_back(Tab{
.title = title,
.button = add_child<Button>(mRoot,
.button = add_child<Button>(
Button::Props{
.text = title,
.onPressed = [this, index](Rml::Event&) { set_active_tab(index); },
.selected = selected,
},
"tab"),
"tab").on_pressed([this, index] { set_active_tab(index); }),
.callback = std::move(callback),
});
}