diff --git a/radio/src/thirdparty/libopenui/src/form.cpp b/radio/src/thirdparty/libopenui/src/form.cpp index 25f9575c6..f4063f317 100644 --- a/radio/src/thirdparty/libopenui/src/form.cpp +++ b/radio/src/thirdparty/libopenui/src/form.cpp @@ -35,7 +35,7 @@ FormField::FormField(Window *parent, const rect_t & rect, WindowFlags windowFlag #if defined(HARDWARE_KEYS) void FormField::onEvent(event_t event) { - TRACE_WINDOWS("%s received event 0x%X", FormField::getWindowDebugString("FormField").c_str(), event); + TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("FormField").c_str(), event); if (event == EVT_ROTARY_RIGHT/*EVT_KEY_BREAK(KEY_DOWN)*/) { if (next) { @@ -97,7 +97,7 @@ void FormGroup::addField(FormField * field) void FormGroup::setFocus(uint8_t flag) { - TRACE_WINDOWS("FormGroup::setFocus(%d)", flag); + TRACE_WINDOWS("%s setFocus(%d)", getWindowDebugString("FormGroup").c_str(), flag); if (windowFlags & FORM_FORWARD_FOCUS) { switch (flag) { @@ -154,16 +154,16 @@ void FormGroup::onEvent(event_t event) TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("FormGroup").c_str(), event); if (event == EVT_KEY_BREAK(KEY_ENTER)) { - first->setFocus(); + first->setFocus(SET_FOCUS_FIRST); } - else if (event == EVT_KEY_BREAK(KEY_EXIT) && !hasFocus()) { + else if (event == EVT_KEY_BREAK(KEY_EXIT) && !hasFocus() && !(windowFlags & FORM_FORWARD_FOCUS)) { setFocus(SET_FOCUS_DEFAULT); } else if (event == EVT_ROTARY_RIGHT && !next) { - first->setFocus(); + first->setFocus(SET_FOCUS_FIRST); } else if (event == EVT_ROTARY_LEFT && !previous) { - last->setFocus(); + last->setFocus(SET_FOCUS_FIRST); } else { FormField::onEvent(event); diff --git a/radio/src/thirdparty/libopenui/src/window.cpp b/radio/src/thirdparty/libopenui/src/window.cpp index 99dbec8d8..6fbbfe257 100644 --- a/radio/src/thirdparty/libopenui/src/window.cpp +++ b/radio/src/thirdparty/libopenui/src/window.cpp @@ -209,11 +209,11 @@ void Window::fullPaint(BitmapBuffer * dc) } if (paintNeeded) { - TRACE_WINDOWS("%s", getWindowDebugString().c_str()); + TRACE_WINDOWS_INDENT("%s", getWindowDebugString().c_str()); paint(dc); } else { - TRACE_WINDOWS("%s (skipped)", getWindowDebugString().c_str()); + TRACE_WINDOWS_INDENT("%s (skipped)", getWindowDebugString().c_str()); } if (!(windowFlags & NO_SCROLLBAR)) { diff --git a/radio/src/thirdparty/libopenui/src/window.h b/radio/src/thirdparty/libopenui/src/window.h index 1f8ed5a53..009e7a061 100644 --- a/radio/src/thirdparty/libopenui/src/window.h +++ b/radio/src/thirdparty/libopenui/src/window.h @@ -87,9 +87,9 @@ class Window { return result; } - std::string getWindowDebugString(const char * name = nullptr) + std::string getWindowDebugString(const char * name = nullptr, bool indent = true) { - return getIndentString() + getName() + (name ? std::string("/") + name : "") + " " + getRectString(); + return getName() + (name ? std::string("[") + name + "]" : "") + " " + getRectString(); } #endif