mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 15:00:54 +03:00
MenuItem: fixed horizontal alignment of icons (issue #631)
This commit is contained in:
@@ -26,6 +26,7 @@ FlatLaf Change Log
|
|||||||
#625)
|
#625)
|
||||||
- Updated "Hiberbee Dark" and "Material Theme UI Lite" themes.
|
- Updated "Hiberbee Dark" and "Material Theme UI Lite" themes.
|
||||||
- Styling: Fixed resolving of UI variables in styles that use other variables.
|
- Styling: Fixed resolving of UI variables in styles that use other variables.
|
||||||
|
- MenuItem: Fixed horizontal alignment of icons. (issue #631)
|
||||||
|
|
||||||
|
|
||||||
## 3.0
|
## 3.0
|
||||||
|
|||||||
@@ -456,10 +456,11 @@ debug*/
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// center because the real icon may be smaller than dimension in iconRect
|
// center because the real icon may be smaller than dimension in iconRect
|
||||||
|
int x = iconRect.x + centerOffset( iconRect.width, icon.getIconWidth() );
|
||||||
int y = iconRect.y + centerOffset( iconRect.height, icon.getIconHeight() );
|
int y = iconRect.y + centerOffset( iconRect.height, icon.getIconHeight() );
|
||||||
|
|
||||||
// paint
|
// paint
|
||||||
icon.paintIcon( menuItem, g, iconRect.x, y );
|
icon.paintIcon( menuItem, g, x, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void paintText( Graphics g, JMenuItem menuItem,
|
protected static void paintText( Graphics g, JMenuItem menuItem,
|
||||||
|
|||||||
Reference in New Issue
Block a user