From 5a66247b2ed3fe4d36dde5f484645e514854fe93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 5 Nov 2022 13:06:58 +0100 Subject: [PATCH] Fixed #1770 Links in basictag info (like needed/dependent characters) were barely visible on most themes --- CHANGELOG.md | 2 ++ .../decompiler/flash/gui/TagInfoPanel.java | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73f5f585b..cb623645b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java b/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java index 794a91c7a..5d49a9f73 100644 --- a/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java @@ -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); + } }