Skip to content

Commit

Permalink
fix: member tray laf
Browse files Browse the repository at this point in the history
  • Loading branch information
litwak913 committed Nov 10, 2024
1 parent 4e452a1 commit 6467fda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
18 changes: 8 additions & 10 deletions core/src/cn/harryh/arkpets/tray/MemberTray.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ public abstract class MemberTray {

static {
// Avoid AWT Thread problem.
SwingUtilities.invokeLater(() -> {
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.setLookAndFeel(laf);
} catch (Exception ignored) {}
});
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.setLookAndFeel(laf);
} catch (Exception ignored) {}
Const.FontsConfig.loadFontsToSwing();
}

Expand Down
2 changes: 0 additions & 2 deletions core/src/cn/harryh/arkpets/tray/MemberTrayImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ public void firePopupMenuWillBecomeInvisible() {
onDisconnected();
client.connectWithRetry(onConnected, session);
}
SwingUtilities.updateComponentTreeUI(popMenu);
popMenu.pack();
}

private static String getName(ArkPets boundArkPets) {
Expand Down

0 comments on commit 6467fda

Please sign in to comment.