1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2024-11-30 13:13:58 +01:00

Add a fancy skinned version of the launcher.

This commit is contained in:
sk89q 2015-02-19 03:13:07 -08:00
parent c41fb73bd1
commit ab6ec9ed71
4 changed files with 50 additions and 2 deletions

View File

@ -0,0 +1,20 @@
apply plugin: 'com.github.johnrengelman.shadow'
jar {
manifest {
attributes("Main-Class": "com.skcraft.launcher.FancyLauncher")
}
}
dependencies {
compile project(':launcher')
compile 'com.github.insubstantial:substance:7.3'
}
shadowJar {
dependencies {
exclude(dependency('org.projectlombok:lombok'))
}
}
build.dependsOn(shadowJar)

View File

@ -0,0 +1,17 @@
package com.skcraft.launcher;
import javax.swing.*;
public class FancyLauncher {
public static void main(String[] args) {
UIManager.getLookAndFeelDefaults().put("ClassLoader", FancyLauncher.class.getClassLoader());
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
System.setProperty("sun.awt.noerasebackground", "true");
System.setProperty("substancelaf.windowRoundedCorners", "false");
System.setProperty("com.skcraft.launcher.laf", "org.pushingpixels.substance.api.skin.SubstanceMarinerLookAndFeel");
Launcher.main(args);
}
}

View File

@ -349,7 +349,18 @@ public final class Launcher {
@Override @Override
public void run() { public void run() {
try { try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); String lafName = System.getProperty("com.skcraft.launcher.laf");
if (lafName != null) {
try {
UIManager.setLookAndFeel(lafName);
} catch (Exception e) {
log.log(Level.WARNING, "Failed to set look and feel to " + lafName, e);
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
} else {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
UIManager.getDefaults().put("SplitPane.border", BorderFactory.createEmptyBorder()); UIManager.getDefaults().put("SplitPane.border", BorderFactory.createEmptyBorder());
Launcher launcher = new Launcher(baseDir); Launcher launcher = new Launcher(baseDir);
new LauncherFrame(launcher).setVisible(true); new LauncherFrame(launcher).setVisible(true);

View File

@ -1,3 +1,3 @@
rootProject.name = 'launcher-parent' rootProject.name = 'launcher-parent'
include 'launcher', 'launcher-builder' include 'launcher', 'launcher-fancy', 'launcher-builder'