From 80a61fb3b776615d7b8c0c8b0a1507e168db0542 Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Fri, 12 Jun 2026 16:41:43 -0400 Subject: [PATCH] btoolbox: focus restoration --- .../lib/borealis/library/lib/core/box.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/Benchmark-Toolbox/lib/borealis/library/lib/core/box.cpp b/Source/Benchmark-Toolbox/lib/borealis/library/lib/core/box.cpp index c671deba..b1411267 100644 --- a/Source/Benchmark-Toolbox/lib/borealis/library/lib/core/box.cpp +++ b/Source/Benchmark-Toolbox/lib/borealis/library/lib/core/box.cpp @@ -561,8 +561,16 @@ void Box::forwardXMLAttribute(std::string attributeName, View* target, std::stri void Box::onChildFocusGained(View* directChild, View* focusedView) { - if (this->hasParent()) + for (size_t i = 0; i < this->children.size(); i++) { + if (this->children[i] == directChild) { + this->defaultFocusedIndex = i; + break; + } + } + + if (this->hasParent()) { this->getParent()->onChildFocusGained(this, focusedView); + } } void Box::onChildFocusLost(View* directChild, View* focusedView)