mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-19 05:02:12 -04:00
Improve add_child and Button APIs
This commit is contained in:
@@ -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),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user