Added on_touch on RSSI widget

This commit is contained in:
GullCode 2023-03-14 00:26:12 +01:00
parent 7a0d02cb83
commit b8c1e8c4a6
2 changed files with 27 additions and 10 deletions

View file

@ -32,6 +32,14 @@
namespace ui {
RSSI::RSSI(
Rect parent_rect,
bool instant_exec
) : Widget { parent_rect },
instant_exec_ { instant_exec }
{
}
void RSSI::paint(Painter& painter) {
const auto r = screen_rect();
@ -352,6 +360,9 @@ namespace ui {
if( on_touch_press) {
on_touch_press(*this);
}
if( on_select && instant_exec_ ) {
on_select(*this);
}
return true;
case TouchEvent::Type::End:
set_highlighted(false);
@ -359,6 +370,9 @@ namespace ui {
if( on_touch_release) {
on_touch_release(*this);
}
if( on_select && !instant_exec_ ) {
on_select(*this);
}
return true;
default:
return false;