mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
JideSplitButton: fixed updating popup when switching theme (issue #1000)
Some checks are pending
CI / build (11) (push) Waiting to run
CI / build-on (17, ) (push) Blocked by required conditions
CI / build-on (21, ) (push) Blocked by required conditions
CI / build-on (23, ) (push) Blocked by required conditions
CI / build-on (8, ) (push) Blocked by required conditions
CI / snapshot (push) Blocked by required conditions
CI / release (push) Blocked by required conditions
Some checks are pending
CI / build (11) (push) Waiting to run
CI / build-on (17, ) (push) Blocked by required conditions
CI / build-on (21, ) (push) Blocked by required conditions
CI / build-on (23, ) (push) Blocked by required conditions
CI / build-on (8, ) (push) Blocked by required conditions
CI / snapshot (push) Blocked by required conditions
CI / release (push) Blocked by required conditions
This commit is contained in:
@@ -4,6 +4,7 @@ FlatLaf Change Log
|
||||
## 3.7-SNAPSHOT
|
||||
|
||||
- Extras: Support JSVG 2.0.0. Minimum JSVG version is now 1.6.0. (issue #997)
|
||||
- JideSplitButton: Fixed updating popup when switching theme. (issue #1000)
|
||||
|
||||
|
||||
## 3.6
|
||||
|
||||
@@ -25,9 +25,11 @@ import java.awt.geom.Rectangle2D;
|
||||
import javax.swing.ButtonModel;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.PopupMenuUI;
|
||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import com.jidesoft.plaf.LookAndFeelFactory;
|
||||
@@ -54,6 +56,14 @@ public class FlatJideSplitButtonUI
|
||||
// but it does not because FlatLaf already has added the UI class to the UI defaults
|
||||
LookAndFeelFactory.installJideExtension();
|
||||
|
||||
// workaround for bug in JideSplitButton, which overrides JMenu.updateUI(),
|
||||
// but does not invoke super.updateUI() to update UI of JMenu.popupMenu field
|
||||
if( c instanceof JideSplitButton ) {
|
||||
JPopupMenu popupMenu = ((JideSplitButton)c).getPopupMenu();
|
||||
if( popupMenu != null )
|
||||
popupMenu.setUI( (PopupMenuUI) UIManager.getUI( popupMenu ) );
|
||||
}
|
||||
|
||||
return new FlatJideSplitButtonUI();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user