mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
fixed jittery submenu rendering on Mac (issue #10)
This commit is contained in:
@@ -5,6 +5,7 @@ FlatLaf Change Log
|
|||||||
|
|
||||||
- Support using IntelliJ platform themes (.theme.json files).
|
- Support using IntelliJ platform themes (.theme.json files).
|
||||||
- Fixed selection background of checkbox in table cell.
|
- Fixed selection background of checkbox in table cell.
|
||||||
|
- Fixed jittery submenu rendering on Mac. (issue #10)
|
||||||
|
|
||||||
|
|
||||||
## 0.18
|
## 0.18
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import javax.swing.AbstractButton;
|
|||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
import javax.swing.LookAndFeel;
|
import javax.swing.LookAndFeel;
|
||||||
|
import javax.swing.PopupFactory;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.UIDefaults;
|
import javax.swing.UIDefaults;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
@@ -92,6 +93,11 @@ public abstract class FlatLaf
|
|||||||
|
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
|
||||||
|
// make sure that a plain popup factory is used (otherwise sub-menu rendering
|
||||||
|
// is "jittery" on Mac, where AquaLookAndFeel installs its own popup factory)
|
||||||
|
if( PopupFactory.getSharedInstance().getClass() != PopupFactory.class )
|
||||||
|
PopupFactory.setSharedInstance( new PopupFactory() );
|
||||||
|
|
||||||
// add mnemonic listener
|
// add mnemonic listener
|
||||||
mnemonicListener = e -> {
|
mnemonicListener = e -> {
|
||||||
if( e.getKeyCode() == KeyEvent.VK_ALT )
|
if( e.getKeyCode() == KeyEvent.VK_ALT )
|
||||||
|
|||||||
Reference in New Issue
Block a user