mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-08-20 14:39:01 +00: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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user