Skip to content

Commit

Permalink
fix: tray separator
Browse files Browse the repository at this point in the history
  • Loading branch information
isHarryh committed Nov 21, 2024
1 parent 7cf086e commit eea092d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions core/src/cn/harryh/arkpets/tray/HostTray.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public class HostTray {
try {
String laf = UIManager.getSystemLookAndFeelClassName();
if (laf.contains("WindowsLookAndFeel")) {
UIManager.put("MenuItem.margin",new Insets(2,-15,2,2));
UIManager.put("Menu.margin",new Insets(2,-15,2,2));
UIManager.put("MenuItem.margin", new Insets(0, -16, 0, 0));
UIManager.put("Menu.margin", new Insets(0, -16, 0, 0));
}
UIManager.setLookAndFeel(laf);
} catch (Exception ignored) {}
Expand All @@ -60,6 +60,7 @@ private HostTray() {
popWindow.setSize(1, 1);
JLabel innerLabel = new JLabel(" ArkPets ");
innerLabel.setAlignmentX(0.5f);
Component innerSep = Box.createVerticalStrut(5);

playerMenu = new JMenu("角色管理");
JMenuItem optExit = new JMenuItem("退出程序");
Expand All @@ -76,7 +77,7 @@ public void firePopupMenuWillBecomeInvisible() {
}
};
popMenu.add(innerLabel);
popMenu.addSeparator();
popMenu.add(innerSep);
popMenu.add(playerMenu);
popMenu.add(optExit);
popMenu.setSize(100, 24 * popMenu.getSubElements().length);
Expand Down
4 changes: 2 additions & 2 deletions core/src/cn/harryh/arkpets/tray/MemberTray.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public abstract class MemberTray {
try {
String laf = UIManager.getSystemLookAndFeelClassName();
if (laf.contains("WindowsLookAndFeel")) {
UIManager.put("MenuItem.margin", new Insets(2, -15, 2, 2));
UIManager.put("Menu.margin", new Insets(2, -15, 2, 2));
UIManager.put("MenuItem.margin", new Insets(0, -18, 0, 0));
UIManager.put("Menu.margin", new Insets(0, -18, 0, 0));
}
UIManager.setLookAndFeel(laf);
} catch (Exception ignored) {}
Expand Down

0 comments on commit eea092d

Please sign in to comment.