* Compact CodePanel labels and TabToolTip * Remove top padding from tab title
This commit is contained in:
@@ -4,6 +4,7 @@ import javax.swing.*;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import jadx.gui.treemodel.JClass;
|
||||
import jadx.gui.treemodel.JNode;
|
||||
|
||||
public abstract class ContentPanel extends JPanel {
|
||||
@@ -38,6 +39,10 @@ public abstract class ContentPanel extends JPanel {
|
||||
*/
|
||||
@Nullable
|
||||
public String getTabTooltip() {
|
||||
return null;
|
||||
JClass jClass = node.getRootClass();
|
||||
if (jClass != null) {
|
||||
return jClass.getFullName();
|
||||
}
|
||||
return node.getName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,13 @@ public class TabComponent extends JPanel {
|
||||
panel.setOpaque(false);
|
||||
|
||||
JNode node = contentPanel.getNode();
|
||||
label = new JLabel(node.makeLongStringHtml());
|
||||
String tabTitle;
|
||||
if (node.getRootClass() != null) {
|
||||
tabTitle = node.getRootClass().getName();
|
||||
} else {
|
||||
tabTitle = node.makeLongStringHtml();
|
||||
}
|
||||
label = new JLabel(tabTitle);
|
||||
label.setFont(getLabelFont());
|
||||
String toolTip = contentPanel.getTabTooltip();
|
||||
if (toolTip != null) {
|
||||
@@ -89,7 +95,7 @@ public class TabComponent extends JPanel {
|
||||
|
||||
panel.add(label);
|
||||
panel.add(closeBtn);
|
||||
panel.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0));
|
||||
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
private JPopupMenu createTabPopupMenu(final ContentPanel contentPanel) {
|
||||
|
||||
Reference in New Issue
Block a user