From a0e434f45e520cd343a002e6220c34d3a517c150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Thu, 1 Aug 2024 12:33:04 +0200 Subject: [PATCH] Added [#2263] Expand one level more (+ sign) for needed/dependent characters in tag info panel to show full tag name as in tree --- CHANGELOG.md | 5 ++- .../decompiler/flash/gui/TagInfoPanel.java | 38 ++++++++++++++----- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f14ad7516..cec2f1bc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ All notable changes to this project will be documented in this file. - FLA export - ImportAssets/2 tag support - FLA export - export in frame 1 flag support - [#2260] GFX - Configure path resolving dialog for file paths that use prefixes like `data:` +- [#2263] Expand one level more (`+` sign) for needed/dependent characters + in tag info panel to show full tag name as in tree ### Fixed - Debugger - getting children of top level variables @@ -3436,6 +3438,8 @@ Major version of SWF to XML export changed to 2. [#2011]: https://www.free-decompiler.com/flash/issues/2011 [#2215]: https://www.free-decompiler.com/flash/issues/2215 [#2243]: https://www.free-decompiler.com/flash/issues/2243 +[#2260]: https://www.free-decompiler.com/flash/issues/2260 +[#2263]: https://www.free-decompiler.com/flash/issues/2263 [#2149]: https://www.free-decompiler.com/flash/issues/2149 [#2172]: https://www.free-decompiler.com/flash/issues/2172 [#2174]: https://www.free-decompiler.com/flash/issues/2174 @@ -3455,7 +3459,6 @@ Major version of SWF to XML export changed to 2. [#2257]: https://www.free-decompiler.com/flash/issues/2257 [#2253]: https://www.free-decompiler.com/flash/issues/2253 [#2239]: https://www.free-decompiler.com/flash/issues/2239 -[#2260]: https://www.free-decompiler.com/flash/issues/2260 [#2206]: https://www.free-decompiler.com/flash/issues/2206 [#2100]: https://www.free-decompiler.com/flash/issues/2100 [#2123]: https://www.free-decompiler.com/flash/issues/2123 diff --git a/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java b/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java index 8464c0eed..cd885ece0 100644 --- a/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java @@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.tags.TagInfo; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.treeitems.TreeItem; +import com.jpexs.helpers.Helper; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; @@ -80,7 +81,12 @@ public class TagInfoPanel extends JPanel { TreeItem item = null; if ("expand".equals(scheme)) { - updateHtmlContent(true); + if ("all".equals(strId)) { + updateHtmlContent(true, false); + } + if ("details".equals(strId)) { + updateHtmlContent(true, true); + } } else if ("char".equals(scheme)) { item = swf.getCharacter(id); } else if ("frame".equals(scheme)) { @@ -105,7 +111,7 @@ public class TagInfoPanel extends JPanel { buildHtmlContent(); } - private void updateHtmlContent(boolean expand) { + private void updateHtmlContent(boolean expand, boolean showDetails) { String categoryName = "general"; String result = ""; Boolean flipFlop = false; @@ -177,13 +183,23 @@ public class TagInfoPanel extends JPanel { if (!frameList && expand) { String charName; CharacterTag character = swf == null ? null : swf.getCharacter(id); - if (swf == null || character == null) { - charName = "???"; + + if (showDetails) { + if (swf == null || character == null) { + charName = "???"; + } else { + charName = Helper.escapeHTML(character.toString()); + } + strValue += String.format("%s
", scheme, id, charName, id); } else { - charName = character.getTagName(); - } + if (swf == null || character == null) { + charName = "???"; + } else { + charName = character.getTagName(); + } - strValue += String.format("%s (%d)
", scheme, id, charName, id); + strValue += String.format("%s (%d)
", scheme, id, charName, id); + } } else { strValue += String.format("%d, ", scheme, id, displayId); } @@ -192,8 +208,10 @@ public class TagInfoPanel extends JPanel { value = strValue.substring(0, strValue.length() - 2); if (!frameList && !expand) { - value = value + " +"; - } + value = value + " +"; + } else if (!frameList && expand && !showDetails) { + value = value + "
+"; + } } result += ""; @@ -207,7 +225,7 @@ public class TagInfoPanel extends JPanel { } private void buildHtmlContent() { - updateHtmlContent(false); + updateHtmlContent(false, false); Font font = UIManager.getFont("Table.font"); String bodyRule = "body { font-family: " + font.getFamily() + ";"
" + value + "