mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-16 13:18:40 +00:00
Fixed nested focus issues for direct focus (i.e. mouse click) instead of
incremental (i.e. tab)
This commit is contained in:
parent
f7dbb0deb6
commit
206c756c0c
@ -298,6 +298,14 @@ bool LayoutBase::SetFocus(IWindowPtr focus) {
|
||||
else {
|
||||
for (size_t i = 0; i < this->focusable.size(); i++) {
|
||||
if (this->focusable[i] == focus) {
|
||||
/* if we're focused, we need to ensure our parent sets its correct
|
||||
focus index to us! and so on up to the root view. note that this
|
||||
needs to be called before updating our internal focus; recursively,
|
||||
parents need to have their focus index set before children */
|
||||
auto asLayout = dynamic_cast<ILayout*>(this->GetParent());
|
||||
if (asLayout) {
|
||||
asLayout->SetFocus(shared_from_this());
|
||||
}
|
||||
this->focused = i;
|
||||
this->EnsureValidFocus();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user