未验证 提交 4835b1b8 编写于 作者: S Surendrajat 提交者: GitHub

fix(gui): compact TabComponent labels and TabToolTip (#1120) (PR #1121)

* Compact CodePanel labels and TabToolTip
* Remove top padding from tab title
上级 67def631
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册