Fix disabled widgets sharing the same space as active widgets (#20535)

* Fix disabled widgets sharing the same space as active widgets

* Add PR for reference in comment

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
This commit is contained in:
Matthias Moninger 2023-07-02 22:34:02 +03:00 committed by GitHub
parent 62914a39fb
commit 0b9639eb25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -805,13 +805,20 @@ void WindowAlignTabs(WindowBase* w, WidgetIndex start_tab_id, WidgetIndex end_ta
for (i = start_tab_id; i <= end_tab_id; i++)
{
auto& widget = w->widgets[i];
if (!WidgetIsDisabled(*w, i))
{
auto& widget = w->widgets[i];
widget.left = x;
widget.right = x + tab_width;
x += tab_width + 1;
}
else
{
// Workaround #20535: Avoid disabled widgets from sharing the same space as active ones, otherwise
// WindowFindWidgetFromPoint could return the disabled one, causing issues.
widget.left = 0;
widget.right = 0;
}
}
}