mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Fix for the freezing when no on_touch_release function
This commit is contained in:
parent
883a62238d
commit
f3503e6844
@ -913,12 +913,12 @@ bool Button::on_touch(const TouchEvent event) {
|
|||||||
case TouchEvent::Type::End:
|
case TouchEvent::Type::End:
|
||||||
set_highlighted(false);
|
set_highlighted(false);
|
||||||
set_dirty();
|
set_dirty();
|
||||||
if( on_select && !instant_exec_ ) {
|
|
||||||
on_select(*this);
|
|
||||||
}
|
|
||||||
if( on_touch_release) {
|
if( on_touch_release) {
|
||||||
on_touch_release(*this);
|
on_touch_release(*this);
|
||||||
}
|
}
|
||||||
|
if( on_select && !instant_exec_ ) {
|
||||||
|
on_select(*this);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -378,8 +378,8 @@ private:
|
|||||||
class Button : public Widget {
|
class Button : public Widget {
|
||||||
public:
|
public:
|
||||||
std::function<void(Button&)> on_select { };
|
std::function<void(Button&)> on_select { };
|
||||||
std::function<void(Button&)> on_touch_release { nullptr }; // Executed when releasing touch, after on_select.
|
std::function<void(Button&)> on_touch_release { }; // Executed when releasing touch, after on_select.
|
||||||
std::function<void(Button&)> on_touch_press { nullptr }; // Executed when touching, before on_select.
|
std::function<void(Button&)> on_touch_press { }; // Executed when touching, before on_select.
|
||||||
std::function<bool(Button&, KeyEvent)> on_dir { };
|
std::function<bool(Button&, KeyEvent)> on_dir { };
|
||||||
std::function<void(Button&)> on_highlight { };
|
std::function<void(Button&)> on_highlight { };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user