Fixed #1770 Links in basictag info (like needed/dependent characters) were barely visible on most themes

This commit is contained in:
Jindra Petřík
2022-11-05 13:06:58 +01:00
parent 0c84d5c6bd
commit 5a66247b2e
2 changed files with 18 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
- GFX: DefineExternalImage/2, DefineSubImage disallow not working replace button in favor of raw editing
- [#1795] AS3 P-code - optional (default parameter values) saving
- [#1785] AS1/2 try..catch block in for..in
- [#1770] Links in basictag info (like needed/dependent characters) were barely visible on most themes
## [16.0.4] - 2022-11-03
### Fixed
@@ -2486,6 +2487,7 @@ All notable changes to this project will be documented in this file.
[#1818]: https://www.free-decompiler.com/flash/issues/1818
[#1795]: https://www.free-decompiler.com/flash/issues/1795
[#1785]: https://www.free-decompiler.com/flash/issues/1785
[#1770]: https://www.free-decompiler.com/flash/issues/1770
[#1860]: https://www.free-decompiler.com/flash/issues/1860
[#1782]: https://www.free-decompiler.com/flash/issues/1782
[#1679]: https://www.free-decompiler.com/flash/issues/1679

View File

@@ -193,13 +193,23 @@ public class TagInfoPanel extends JPanel {
+ "td { border: 1px solid #e4e4e4; }"
+ "html { border: 1px solid #789AC4; }";
} else {
Color bgColor = UIManager.getColor("Table.background");
int light = (bgColor.getRed() + bgColor.getGreen() + bgColor.getBlue()) / 3;
boolean nightMode = light <= 128;
Color linkColor = Color.blue;
if (nightMode) {
linkColor = new Color(0x88,0x88,0xff);
}
bodyRule += "background-color: " + getUIColorToHex("Table.background") + ";"
+ "color:" + getUIColorToHex("Table.foreground") + ";"
+ "padding:1px;"
+ "}"
+ "td { border: 1px solid " + getUIColorToHex("Table.gridColor") + "; }"
+ "html { border: 1px solid " + getUIColorToHex("Table.gridColor") + "; }"
+ "a {color: " + getUIColorToHex("List.selectionBackground") + "}";
+ "a {color: " + getColorToHex(linkColor) + "}"
;
}
((HTMLDocument) editorPane.getDocument()).getStyleSheet().addRule(bodyRule);
@@ -209,8 +219,11 @@ public class TagInfoPanel extends JPanel {
editorPane.setEditable(false);
}
private static String getUIColorToHex(String name) {
Color c = UIManager.getColor(name);
private static String getColorToHex(Color c) {
return String.format("#%02x%02x%02x", c.getRed(), c.getGreen(), c.getBlue());
}
private static String getUIColorToHex(String name) {
Color c = UIManager.getColor(name);
return getColorToHex(c);
}
}