fixed jittery submenu rendering on Mac (issue #10)

This commit is contained in:
Karl Tauber
2019-11-15 18:24:22 +01:00
parent 3ba8133890
commit d72cfc37d6
2 changed files with 7 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ FlatLaf Change Log
- Support using IntelliJ platform themes (.theme.json files).
- Fixed selection background of checkbox in table cell.
- Fixed jittery submenu rendering on Mac. (issue #10)
## 0.18

View File

@@ -33,6 +33,7 @@ import javax.swing.AbstractButton;
import javax.swing.JLabel;
import javax.swing.JTabbedPane;
import javax.swing.LookAndFeel;
import javax.swing.PopupFactory;
import javax.swing.SwingUtilities;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
@@ -92,6 +93,11 @@ public abstract class FlatLaf
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
mnemonicListener = e -> {
if( e.getKeyCode() == KeyEvent.VK_ALT )