Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lightcrafts/src/main/java/com/lightcrafts/app/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,19 @@ public static void openFrom(File file, OtherApplication otherApp) {

public static void reOpen(ComboFrame frame) {
if (frame == null) {
// macOS dock-icon reopen: focus most-recently-active frame instead of spawning a duplicate.
ComboFrame existing = getActiveFrame();
if (existing != null) {
if (existing.getState() == Frame.ICONIFIED) {
existing.setState(Frame.NORMAL);
}
existing.setVisible(true);
existing.toFront();
existing.requestFocus();
return;
}
openEmpty();
return;
return;
}
Document doc = frame.getDocument();
File file = doc.getFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ private static Color relight(Color color, float amount) {
}

public static class LightZoneFontSet {
// cf. https://www.formdev.com/flatlaf/typography/#available
public static final FontUIResource TitleFont = new FontUIResource(UIManager.getFont("small.font"));
public static final FontUIResource SmallFont = new FontUIResource(UIManager.getFont("small.font"));
// FlatLaf "small.font" key is not present in every theme variant; hardcode to avoid NPE.
public static final FontUIResource TitleFont = new FontUIResource(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
public static final FontUIResource SmallFont = new FontUIResource(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
}

public static Border getImageBorder() {
Expand Down
5 changes: 5 additions & 0 deletions macosx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ dependencies {
}
application {
mainClass.set("com.lightcrafts.platform.macosx.MacOSXLauncher")
applicationDefaultJvmArgs = applicationDefaultJvmArgs + listOf(
"-Xdock:name=LightZone",
"-Dapple.awt.application.name=LightZone",
)
}
tasks {
build {
Expand Down Expand Up @@ -86,6 +90,7 @@ runtime {
"-Djava.library.path=\$APPDIR",
"-Dfile.encoding=utf-8",
"-Xdock:name=LightZone",
"-Dapple.awt.application.name=LightZone",
)
}
}
Loading