mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
MenuBar: fixed NPE in FlatMenuItemRenderer.getTopLevelFont() if menu item does not have a parent (issue #600; regression since implementing #589 in FlatLaf 2.5; commit f6c5db07f2)
This commit is contained in:
@@ -12,6 +12,9 @@ FlatLaf Change Log
|
|||||||
|
|
||||||
- ComboBox and Spinner: Fixed missing arrow buttons if preferred height is zero.
|
- ComboBox and Spinner: Fixed missing arrow buttons if preferred height is zero.
|
||||||
Minimum width of arrow buttons is 3/4 of default width.
|
Minimum width of arrow buttons is 3/4 of default width.
|
||||||
|
- MenuBar: Fixed NPE in `FlatMenuItemRenderer.getTopLevelFont()` if menu item
|
||||||
|
does not have a parent. (issue #600; regression since implementing #589 in
|
||||||
|
FlatLaf 2.5)
|
||||||
- TabbedPane: Switch and close tabs on left mouse click only. (PR #595)
|
- TabbedPane: Switch and close tabs on left mouse click only. (PR #595)
|
||||||
- ScrollBar: Show "pressed" feedback on track/thumb only for left mouse button.
|
- ScrollBar: Show "pressed" feedback on track/thumb only for left mouse button.
|
||||||
If absolute positioning is enabled (the default), then also for middle mouse
|
If absolute positioning is enabled (the default), then also for middle mouse
|
||||||
|
|||||||
@@ -500,7 +500,11 @@ debug*/
|
|||||||
|
|
||||||
private Font getTopLevelFont() {
|
private Font getTopLevelFont() {
|
||||||
Font font = menuItem.getFont();
|
Font font = menuItem.getFont();
|
||||||
return (font != menuFont) ? font : menuItem.getParent().getFont();
|
// menu item parent may be null if JMenu.isTopLevelMenu() is overridden
|
||||||
|
// and does not check parent (e.g. com.jidesoft.swing.JideMenu.isTopLevelMenu())
|
||||||
|
return (font != menuFont || menuItem.getParent() == null)
|
||||||
|
? font
|
||||||
|
: menuItem.getParent().getFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Icon getIconForPainting() {
|
private Icon getIconForPainting() {
|
||||||
|
|||||||
Reference in New Issue
Block a user