1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2024-11-24 12:16:28 +01:00

Fix some native compatibility issues.

This commit is contained in:
sk89q 2015-07-24 11:54:08 -07:00
parent 9647768a1a
commit 4a35f5f5b6
5 changed files with 17 additions and 6 deletions

View File

@ -70,7 +70,7 @@ public class Creator {
final Creator creator = new Creator();
SwingUtilities.invokeAndWait(() -> {
UIManager.getDefaults().put("SplitPane.border", BorderFactory.createEmptyBorder());
SwingHelper.setSwingProperties("Modpack Creator");
SwingHelper.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
try {

View File

@ -101,10 +101,12 @@ public class PackManagerFrame extends JFrame {
}
private void initMenu() {
newPackMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, Event.CTRL_MASK));
newPackAtLocationMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, Event.CTRL_MASK | Event.SHIFT_MASK));
editConfigMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, Event.CTRL_MASK));
openFolderMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Event.CTRL_MASK | Event.SHIFT_MASK));
int ctrlKeyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
newPackMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ctrlKeyMask));
newPackAtLocationMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ctrlKeyMask | Event.SHIFT_MASK));
editConfigMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, ctrlKeyMask));
openFolderMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ctrlKeyMask | Event.SHIFT_MASK));
testMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0));
testOnlineMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0));
buildMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F10, Event.SHIFT_MASK));

View File

@ -42,6 +42,8 @@ import java.util.Properties;
import java.util.concurrent.Executors;
import java.util.logging.Level;
import static com.skcraft.launcher.util.SharedLocale.tr;
/**
* The main entry point for the launcher.
*/
@ -390,8 +392,8 @@ public final class Launcher {
public void run() {
try {
Launcher launcher = createFromArguments(args);
SwingHelper.setSwingProperties(tr("launcher.appTitle", launcher.getVersion()));
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.getDefaults().put("SplitPane.border", BorderFactory.createEmptyBorder());
launcher.showLauncherWindow();
} catch (Throwable t) {
log.log(Level.WARNING, "Load failure", t);

View File

@ -452,4 +452,10 @@ public final class SwingHelper {
return false;
}
}
public static void setSwingProperties(String appName) {
UIManager.getDefaults().put("SplitPane.border", BorderFactory.createEmptyBorder());
System.setProperty("com.apple.mrj.application.apple.menu.about.name", appName);
System.setProperty("apple.laf.useScreenMenuBar", "true");
}
}

View File

@ -65,6 +65,7 @@ launcher.options=Options...
launcher.updateLauncher=Update launcher...
launcher.downloadUpdates=Download modpack updates
launcher.title=SKCraft Launcher (v{0})
launcher.appTitle=SKCraft Launcher
launcher.refreshList=Refresh list
launcher.checkingTitle=Getting available modpacks...
launcher.checkingStatus=Getting available modpacks... Please wait.