Touch for MenuView and Freqlist (#2829)

* freqman add touch support. solves #1919

* menuview touch support
This commit is contained in:
Totoo 2025-10-17 15:59:35 +02:00 committed by GitHub
parent e88ab44f49
commit cbbd8103d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 42 additions and 1 deletions

View file

@ -243,6 +243,18 @@ void MenuView::on_blur() {
item_view(highlighted_item - offset)->unhighlight();
}
bool MenuView::on_touch(const TouchEvent event) {
size_t i = 0;
for (const auto child : children_) {
if (i >= menu_item_views.size()) break;
if (child->screen_rect().contains(event.point)) {
return set_highlighted(i + offset);
}
i++;
}
return false;
}
bool MenuView::on_key(const KeyEvent key) {
switch (key) {
case KeyEvent::Up: