mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-11-30 00:16:46 -05:00
Touch for MenuView and Freqlist (#2829)
* freqman add touch support. solves #1919 * menuview touch support
This commit is contained in:
parent
e88ab44f49
commit
cbbd8103d3
5 changed files with 42 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue