mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 15:00:54 +03:00
ToolBar: fixed endless loop in focus navigation that may occur under special circumstances (issue #505)
This commit is contained in:
@@ -7,6 +7,8 @@ FlatLaf Change Log
|
|||||||
|
|
||||||
- Native window decorations (Windows 10/11 only): Fixed wrong window title
|
- Native window decorations (Windows 10/11 only): Fixed wrong window title
|
||||||
character encoding used in Windows taskbar. (issue #502)
|
character encoding used in Windows taskbar. (issue #502)
|
||||||
|
- ToolBar: Fixed endless loop in focus navigation that may occur under special
|
||||||
|
circumstances. (issue #505)
|
||||||
|
|
||||||
|
|
||||||
## 2.1
|
## 2.1
|
||||||
|
|||||||
@@ -256,11 +256,15 @@ public class FlatToolBarUI
|
|||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( int i = focusedCompIndex + add; i != focusedCompIndex; i += add ) {
|
int i = focusedCompIndex;
|
||||||
|
for(;;) {
|
||||||
|
i += add;
|
||||||
if( i < 0 )
|
if( i < 0 )
|
||||||
i = count - 1;
|
i = count - 1;
|
||||||
else if( i >= count )
|
else if( i >= count )
|
||||||
i = 0;
|
i = 0;
|
||||||
|
if( i == focusedCompIndex )
|
||||||
|
break;
|
||||||
|
|
||||||
Component c = toolBar.getComponentAtIndex( i );
|
Component c = toolBar.getComponentAtIndex( i );
|
||||||
if( canBeFocusOwner( c ) ) {
|
if( canBeFocusOwner( c ) ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user