mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 14:30:56 +03:00
ToolBar: fixed endless loop if button in Toolbar has focus and is made invisible (issue #884)
Some checks failed
CI / build (11, ) (push) Has been cancelled
CI / build (17, ) (push) Has been cancelled
CI / build (21, ) (push) Has been cancelled
CI / build (21, 22) (push) Has been cancelled
CI / build (8, ) (push) Has been cancelled
CI / snapshot (push) Has been cancelled
CI / release (push) Has been cancelled
Some checks failed
CI / build (11, ) (push) Has been cancelled
CI / build (17, ) (push) Has been cancelled
CI / build (21, ) (push) Has been cancelled
CI / build (21, 22) (push) Has been cancelled
CI / build (8, ) (push) Has been cancelled
CI / snapshot (push) Has been cancelled
CI / release (push) Has been cancelled
This commit is contained in:
@@ -9,6 +9,8 @@ FlatLaf Change Log
|
|||||||
using custom component that overrides `Component.contains(int x, int y)` and
|
using custom component that overrides `Component.contains(int x, int y)` and
|
||||||
invokes `SwingUtilities.convertPoint()` (or similar) from the overridden
|
invokes `SwingUtilities.convertPoint()` (or similar) from the overridden
|
||||||
method. (issue #878)
|
method. (issue #878)
|
||||||
|
- ToolBar: Fixed endless loop if button in Toolbar has focus and is made
|
||||||
|
invisible. (issue #884)
|
||||||
|
|
||||||
|
|
||||||
## 3.5.1
|
## 3.5.1
|
||||||
|
|||||||
@@ -531,8 +531,11 @@ public class FlatToolBarUI
|
|||||||
|
|
||||||
private Component getRecentComponent( Container aContainer, boolean first ) {
|
private Component getRecentComponent( Container aContainer, boolean first ) {
|
||||||
// if moving focus into the toolbar, focus recently focused toolbar button
|
// if moving focus into the toolbar, focus recently focused toolbar button
|
||||||
if( focusedCompIndex >= 0 && focusedCompIndex < toolBar.getComponentCount() )
|
if( focusedCompIndex >= 0 && focusedCompIndex < toolBar.getComponentCount() ) {
|
||||||
return toolBar.getComponent( focusedCompIndex );
|
Component c = toolBar.getComponent( focusedCompIndex );
|
||||||
|
if( accept( c ) )
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
return first
|
return first
|
||||||
? super.getFirstComponent( aContainer )
|
? super.getFirstComponent( aContainer )
|
||||||
|
|||||||
Reference in New Issue
Block a user