mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 15:07:11 -06:00
ToolTip: do not show empty tooltip component if tooltip text is an empty string (issue #134)
This commit is contained in:
@@ -12,6 +12,8 @@ FlatLaf Change Log
|
|||||||
"JScrollPane.smoothScrolling" is set to a `Boolean` on `JScrollPane`.
|
"JScrollPane.smoothScrolling" is set to a `Boolean` on `JScrollPane`.
|
||||||
- ScrollBar: Increased minimum thumb size on macOS and Linux from 8 to 18
|
- ScrollBar: Increased minimum thumb size on macOS and Linux from 8 to 18
|
||||||
pixels. On Windows, it is now 10 pixels. (issue #131)
|
pixels. On Windows, it is now 10 pixels. (issue #131)
|
||||||
|
- ToolTip: Do not show empty tooltip component if tooltip text is an empty
|
||||||
|
string. (issue #134)
|
||||||
|
|
||||||
|
|
||||||
## 0.38
|
## 0.38
|
||||||
|
|||||||
@@ -94,6 +94,11 @@ public class FlatToolTipUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dimension getPreferredSize( JComponent c ) {
|
public Dimension getPreferredSize( JComponent c ) {
|
||||||
|
// do not show tool tip if text is empty
|
||||||
|
String text = ((JToolTip)c).getTipText();
|
||||||
|
if( text == null || text.isEmpty() )
|
||||||
|
return new Dimension();
|
||||||
|
|
||||||
if( isMultiLine( c ) ) {
|
if( isMultiLine( c ) ) {
|
||||||
FontMetrics fm = c.getFontMetrics( c.getFont() );
|
FontMetrics fm = c.getFontMetrics( c.getFont() );
|
||||||
Insets insets = c.getInsets();
|
Insets insets = c.getInsets();
|
||||||
|
|||||||
Reference in New Issue
Block a user