From 28633e857f86a21d874117fd677de5e8ad21d8d3 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 4 Oct 2023 14:47:30 +1100 Subject: Implement UI for enqueuing instead of replacing the current track --- src/ui/include/modal.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ui/include/modal.hpp') diff --git a/src/ui/include/modal.hpp b/src/ui/include/modal.hpp index a5ac69b8..61e52cdf 100644 --- a/src/ui/include/modal.hpp +++ b/src/ui/include/modal.hpp @@ -30,6 +30,15 @@ class Modal { lv_obj_t* const root_; lv_group_t* const group_; + std::pmr::vector> event_bindings_; + + template + auto lv_bind(lv_obj_t* obj, lv_event_code_t ev, T fn) -> void { + auto binding = std::make_unique(obj, ev); + binding->signal().connect(fn); + event_bindings_.push_back(std::move(binding)); + } + private: Screen* host_; }; -- cgit v1.2.3