diff --git a/firmware/common/ui_widget.cpp b/firmware/common/ui_widget.cpp index 90c544fe..12bf1927 100644 --- a/firmware/common/ui_widget.cpp +++ b/firmware/common/ui_widget.cpp @@ -913,12 +913,12 @@ bool Button::on_touch(const TouchEvent event) { case TouchEvent::Type::End: set_highlighted(false); set_dirty(); - if( on_select && !instant_exec_ ) { - on_select(*this); - } if( on_touch_release) { on_touch_release(*this); } + if( on_select && !instant_exec_ ) { + on_select(*this); + } return true; default: diff --git a/firmware/common/ui_widget.hpp b/firmware/common/ui_widget.hpp index 134f3110..f66da710 100644 --- a/firmware/common/ui_widget.hpp +++ b/firmware/common/ui_widget.hpp @@ -378,8 +378,8 @@ private: class Button : public Widget { public: std::function on_select { }; - std::function on_touch_release { nullptr }; // Executed when releasing touch, after on_select. - std::function on_touch_press { nullptr }; // Executed when touching, before on_select. + std::function on_touch_release { }; // Executed when releasing touch, after on_select. + std::function on_touch_press { }; // Executed when touching, before on_select. std::function on_dir { }; std::function on_highlight { };