Skip to content

Commit

Permalink
Merge pull request #45 from creme332/laf
Browse files Browse the repository at this point in the history
update laf settings
  • Loading branch information
creme332 authored Jun 8, 2024
2 parents ce4714d + f793b76 commit 7dc9c96
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/github/creme332/App.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.github.creme332;

import com.formdev.flatlaf.themes.FlatMacLightLaf;
import com.github.creme332.controller.Controller;
import com.github.creme332.view.PolydrawTheme;

public class App {
public static void main(String[] args) {
FlatMacLightLaf.setup();
PolydrawTheme.setup();
new Controller();
}
}
20 changes: 20 additions & 0 deletions src/main/java/com/github/creme332/view/PolydrawTheme.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.github.creme332.view;

import com.formdev.flatlaf.FlatLightLaf;

public class PolydrawTheme extends FlatLightLaf {
public static boolean setup() {
// do not embed menu bar into the window title pane
System.setProperty("flatlaf.menuBarEmbedded", "false");

// look for properties file in theme folder (relative to resource)
registerCustomDefaultsSource("theme");

return setup(new PolydrawTheme());
}

@Override
public String getName() {
return "PolydrawTheme";
}
}
13 changes: 13 additions & 0 deletions src/main/resources/theme/PolydrawTheme.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
defaultFont = 20

# https://www.formdev.com/flatlaf/components/radiobutton/
RadioButton.background = $Button.background
RadioButton.foreground = $Button.foreground
RadioButton.margin = $Button.margin

h00.font = +24
h0.font = +18
h1.font = +18
h2.font = +6 $semibold.font
h3.font = +5 $semibold.font
h4.font = bold

0 comments on commit 7dc9c96

Please sign in to comment.