-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disable HTML rendering in labels if not needed
- Loading branch information
Showing
13 changed files
with
88 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package jadx.gui.utils.ui; | ||
|
||
import javax.swing.JLabel; | ||
import javax.swing.SwingConstants; | ||
|
||
import jadx.gui.treemodel.JNode; | ||
|
||
public class NodeLabel extends JLabel { | ||
|
||
public static NodeLabel longName(JNode node) { | ||
NodeLabel label = new NodeLabel(node.makeLongStringHtml(), node.disableHtml()); | ||
label.setIcon(node.getIcon()); | ||
label.setHorizontalAlignment(SwingConstants.LEFT); | ||
return label; | ||
} | ||
|
||
public static NodeLabel noHtml(String label) { | ||
return new NodeLabel(label, true); | ||
} | ||
|
||
public static void disableHtml(JLabel label, boolean disable) { | ||
label.putClientProperty("html.disable", disable); | ||
} | ||
|
||
private boolean htmlDisabled = false; | ||
|
||
public NodeLabel() { | ||
disableHtml(true); | ||
} | ||
|
||
public NodeLabel(String label) { | ||
disableHtml(true); | ||
setText(label); | ||
} | ||
|
||
public NodeLabel(String label, boolean disableHtml) { | ||
disableHtml(disableHtml); | ||
setText(label); | ||
} | ||
|
||
public void disableHtml(boolean disable) { | ||
if (htmlDisabled != disable) { | ||
htmlDisabled = disable; | ||
disableHtml(this, disable); | ||
} | ||
} | ||
} |
6844a46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skylot It seem that you disabled HTML rendering a bit too often. In search dialog the result viewer methods some times the HTML code is now shown:
6844a46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpstotz
Oh, this is a stupid rendering issue π
I commit a fix (4db50fb). Thanks for notice π
6844a46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skylot same issue with user added comments:
6844a46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Surendrajat thanks! Fixed in 22ed241 π