mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 22:22:21 -04:00
External module api (#2290)
* added external module debug view * integrated module driver into i2c subsystem * implemented i2c app loader * added view mirror api * fixed build * added i2c to module api * implemented standalone app touch event * implemented focus management * reverted formating change * refactoring * refactoring * implemented events * fixed memory usage
This commit is contained in:
parent
5a0066963e
commit
dcaa02c1e1
18 changed files with 667 additions and 24 deletions
|
@ -38,6 +38,14 @@ Widget* FocusManager::focus_widget() const {
|
|||
return focus_widget_;
|
||||
}
|
||||
|
||||
void FocusManager::setMirror(Widget* const mirror_widget) {
|
||||
mirror_widget_ = mirror_widget;
|
||||
}
|
||||
|
||||
void FocusManager::clearMirror() {
|
||||
mirror_widget_ = nullptr;
|
||||
}
|
||||
|
||||
void FocusManager::set_focus_widget(Widget* const new_focus_widget) {
|
||||
// Widget already has focus.
|
||||
if (new_focus_widget == focus_widget()) {
|
||||
|
@ -153,9 +161,12 @@ static int32_t rect_distances(
|
|||
}
|
||||
}
|
||||
|
||||
void FocusManager::update(
|
||||
Widget* const top_widget,
|
||||
const KeyEvent event) {
|
||||
void FocusManager::update(Widget* const top_widget, const KeyEvent event) {
|
||||
if (mirror_widget_) {
|
||||
if (mirror_widget_->on_key(event))
|
||||
return;
|
||||
}
|
||||
|
||||
if (focus_widget()) {
|
||||
const auto focus_screen_rect = focus_widget()->screen_rect();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue