mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 05:50:53 +03:00
HTML: fixed rendering of <hr noshade> in dark themes (issue #932)
This commit is contained in:
@@ -62,6 +62,7 @@ FlatLaf Change Log
|
||||
- Fixed loading FlatLaf UI delegate classes when using FlatLaf in special
|
||||
application where multiple class loaders are involved. E.g. in Eclipse plugin
|
||||
or in LibreOffice extension. (issues #955 and #851)
|
||||
- HTML: Fixed rendering of `<hr noshade>` in dark themes. (issue #932)
|
||||
|
||||
#### Incompatibilities
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.function.BiPredicate;
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
class StackUtils
|
||||
public class StackUtils
|
||||
{
|
||||
private static final StackUtils INSTANCE = new StackUtilsImpl();
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.formdev.flatlaf.util;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
@@ -27,7 +28,9 @@ import java.awt.geom.Rectangle2D;
|
||||
import java.text.AttributedCharacterIterator;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.RepaintManager;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.FlatSystemProperties;
|
||||
import com.formdev.flatlaf.ui.StackUtils;
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
@@ -323,6 +326,19 @@ public class HiDPIUtils
|
||||
public void drawGlyphVector( GlyphVector g, float x, float y ) {
|
||||
super.drawGlyphVector( g, x, y + yCorrection );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillRect( int x, int y, int width, int height ) {
|
||||
// fix hard coded black color in HRuleView.paint() of '<hr noshade>'
|
||||
if( super.getColor() == Color.black &&
|
||||
StackUtils.wasInvokedFrom( "javax.swing.text.html.HRuleView", "paint", 4 ) )
|
||||
{
|
||||
super.setColor( FlatLaf.isLafDark() ? Color.lightGray : Color.darkGray );
|
||||
super.fillRect( x, y, width, height );
|
||||
super.setColor( Color.black );
|
||||
} else
|
||||
super.fillRect( x, y, width, height );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user