Rework Settings components

This commit is contained in:
Luke Street
2026-05-01 16:14:20 -06:00
parent 81771a0522
commit 68b2e0ee2d
18 changed files with 358 additions and 408 deletions
+4 -4
View File
@@ -31,13 +31,13 @@ Button& Button::on_pressed(ButtonCallback callback) {
if (!callback) {
return *this;
}
listen(Rml::EventId::Click, [callback](Rml::Event&) { callback(); });
listen(Rml::EventId::Keydown, [callback = std::move(callback)](Rml::Event& event) {
const auto cmd = map_nav_event(event);
// TODO: convert this to a FluentComponent method?
on_nav_command([callback = std::move(callback)](Rml::Event&, NavCommand cmd) {
if (cmd == NavCommand::Confirm) {
callback();
event.StopPropagation();
return true;
}
return false;
});
return *this;
}