mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-15 00:08:28 +00:00
#1485 Improved skins support, night mode
This commit is contained in:
@@ -19,7 +19,9 @@ package com.jpexs.decompiler.flash.gui;
|
||||
import java.awt.Color;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import javax.swing.text.html.HTMLDocument;
|
||||
|
||||
public class HtmlLabel extends JEditorPane {
|
||||
|
||||
@@ -53,6 +55,10 @@ public class HtmlLabel extends JEditorPane {
|
||||
}
|
||||
this.rawText = t;
|
||||
super.setText(modText);
|
||||
|
||||
String aRule = "a {color: " + getUIColorToHex("List.selectionBackground") + "}";
|
||||
|
||||
((HTMLDocument) getDocument()).getStyleSheet().addRule(aRule);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,4 +66,9 @@ public class HtmlLabel extends JEditorPane {
|
||||
return rawText;
|
||||
}
|
||||
|
||||
private static String getUIColorToHex(String name) {
|
||||
Color c = UIManager.getColor(name);
|
||||
return String.format("#%02x%02x%02x", c.getRed(), c.getGreen(), c.getBlue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user