mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
ToolTip: fixed left/right insets of multi-line tooltips so that they are the same as in single-line tooltips (BasicToolTipUI adds 3 to the left and right)
This commit is contained in:
@@ -103,7 +103,7 @@ public class FlatToolTipUI
|
|||||||
for( String line : lines )
|
for( String line : lines )
|
||||||
width = Math.max( width, SwingUtilities.computeStringWidth( fm, line ) );
|
width = Math.max( width, SwingUtilities.computeStringWidth( fm, line ) );
|
||||||
|
|
||||||
return new Dimension( insets.left + width + insets.right, insets.top + height + insets.bottom );
|
return new Dimension( insets.left + width + insets.right + 6, insets.top + height + insets.bottom );
|
||||||
} else
|
} else
|
||||||
return super.getPreferredSize( c );
|
return super.getPreferredSize( c );
|
||||||
}
|
}
|
||||||
@@ -119,8 +119,8 @@ public class FlatToolTipUI
|
|||||||
|
|
||||||
List<String> lines = StringUtils.split( ((JToolTip)c).getTipText(), '\n' );
|
List<String> lines = StringUtils.split( ((JToolTip)c).getTipText(), '\n' );
|
||||||
|
|
||||||
int x = insets.left;
|
int x = insets.left + 3;
|
||||||
int x2 = c.getWidth() - insets.right;
|
int x2 = c.getWidth() - insets.right - 3;
|
||||||
int y = insets.top - fm.getDescent();
|
int y = insets.top - fm.getDescent();
|
||||||
int lineHeight = fm.getHeight();
|
int lineHeight = fm.getHeight();
|
||||||
JComponent comp = ((JToolTip)c).getComponent();
|
JComponent comp = ((JToolTip)c).getComponent();
|
||||||
|
|||||||
Reference in New Issue
Block a user