Label: fixed disabled foreground

This commit is contained in:
Karl Tauber
2019-08-19 17:52:40 +02:00
parent 91a3d64a8e
commit cbbbda9dc1
4 changed files with 26 additions and 0 deletions

View File

@@ -16,9 +16,13 @@
package com.formdev.flatlaf.ui;
import java.awt.Graphics;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicLabelUI;
import sun.swing.SwingUtilities2;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JLabel}.
@@ -35,4 +39,11 @@ public class FlatLabelUI
instance = new FlatLabelUI();
return instance;
}
@Override
protected void paintDisabledText( JLabel l, Graphics g, String s, int textX, int textY ) {
int mnemIndex = l.getDisplayedMnemonicIndex();
g.setColor( UIManager.getColor( "Label.disabledForeground" ) );
SwingUtilities2.drawStringUnderlineCharAt( l, g, s, mnemIndex, textX, textY );
}
}

View File

@@ -18,3 +18,8 @@
*.background=3c3f41
*.foreground=bbbbbb
#---- Label ----
Label.disabledForeground=808080

View File

@@ -18,3 +18,8 @@
*.background=f2f2f2
*.foreground=000000
#---- Label ----
Label.disabledForeground=777777

View File

@@ -18,3 +18,8 @@
*.background=ccffcc
*.foreground=ff0000
#---- Label ----
Label.disabledForeground=000088