mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 14:30:56 +03:00
Merge pull request #229
TextField Placeholder now honors the right inset
This commit is contained in:
@@ -39,6 +39,7 @@ import javax.swing.text.Caret;
|
|||||||
import javax.swing.text.JTextComponent;
|
import javax.swing.text.JTextComponent;
|
||||||
import com.formdev.flatlaf.FlatClientProperties;
|
import com.formdev.flatlaf.FlatClientProperties;
|
||||||
import com.formdev.flatlaf.util.HiDPIUtils;
|
import com.formdev.flatlaf.util.HiDPIUtils;
|
||||||
|
import com.formdev.flatlaf.util.JavaCompatibility;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the Flat LaF UI delegate for {@link javax.swing.JTextField}.
|
* Provides the Flat LaF UI delegate for {@link javax.swing.JTextField}.
|
||||||
@@ -213,7 +214,9 @@ public class FlatTextFieldUI
|
|||||||
|
|
||||||
// paint placeholder
|
// paint placeholder
|
||||||
g.setColor( placeholderForeground );
|
g.setColor( placeholderForeground );
|
||||||
FlatUIUtils.drawString( c, g, (String) placeholder, x, y );
|
String clippedPlaceholder = JavaCompatibility.getClippedString( jc, fm,
|
||||||
|
(String) placeholder, c.getWidth() - insets.left - insets.right );
|
||||||
|
FlatUIUtils.drawString( c, g, clippedPlaceholder, x, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user