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:
parent
c41fb73bd1
commit
ab6ec9ed71
20
launcher-fancy/build.gradle
Normal file
20
launcher-fancy/build.gradle
Normal 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)
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
@ -349,7 +349,18 @@ public final class Launcher {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
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());
|
||||
Launcher launcher = new Launcher(baseDir);
|
||||
new LauncherFrame(launcher).setVisible(true);
|
||||
|
@ -1,3 +1,3 @@
|
||||
rootProject.name = 'launcher-parent'
|
||||
|
||||
include 'launcher', 'launcher-builder'
|
||||
include 'launcher', 'launcher-fancy', 'launcher-builder'
|
Loading…
Reference in New Issue
Block a user