Skip to content

Commit

Permalink
移除部分主题风格
Browse files Browse the repository at this point in the history
  • Loading branch information
rememberber committed Jan 7, 2022
1 parent 836fd78 commit 15f4f09
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 66 deletions.
42 changes: 0 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>com.darcula</groupId>
<artifactId>darcula-lnf</artifactId>
<version>1.0</version>
</dependency>

<dependency>
<groupId>com.beautyeye</groupId>
<artifactId>beautyeye-lnf</artifactId>
<version>1.0</version>
</dependency>

<!--文件字符集格式检测-->
<dependency>
<groupId>net.sourceforge.cpdetector</groupId>
Expand Down Expand Up @@ -487,36 +475,6 @@
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-beautyeye</id>
<phase>clean</phase>
<configuration>
<file>lib/beautyeye_lnf.jar</file>
<groupId>com.beautyeye</groupId>
<artifactId>beautyeye-lnf</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
<execution>
<id>install-darcula</id>
<phase>clean</phase>
<configuration>
<file>lib/darcula.jar</file>
<groupId>com.darcula</groupId>
<artifactId>darcula-lnf</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
<execution>
<id>install-taobao-sdk-auto</id>
<phase>clean</phase>
Expand Down
48 changes: 24 additions & 24 deletions src/main/java/com/fangxuele/tool/push/ui/Init.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,7 @@
import cn.hutool.log.LogFactory;
import com.fangxuele.tool.push.App;
import com.fangxuele.tool.push.ui.dialog.FontSizeAdjustDialog;
import com.fangxuele.tool.push.ui.form.AboutForm;
import com.fangxuele.tool.push.ui.form.BoostForm;
import com.fangxuele.tool.push.ui.form.HelpForm;
import com.fangxuele.tool.push.ui.form.InfinityForm;
import com.fangxuele.tool.push.ui.form.MainWindow;
import com.fangxuele.tool.push.ui.form.MemberForm;
import com.fangxuele.tool.push.ui.form.MessageEditForm;
import com.fangxuele.tool.push.ui.form.MessageManageForm;
import com.fangxuele.tool.push.ui.form.MessageTypeForm;
import com.fangxuele.tool.push.ui.form.PushForm;
import com.fangxuele.tool.push.ui.form.PushHisForm;
import com.fangxuele.tool.push.ui.form.ScheduleForm;
import com.fangxuele.tool.push.ui.form.SettingForm;
import com.fangxuele.tool.push.ui.form.*;
import com.fangxuele.tool.push.ui.listener.AboutListener;
import com.fangxuele.tool.push.util.SystemUtil;
import com.fangxuele.tool.push.util.UIUtil;
Expand All @@ -26,7 +14,6 @@
import com.formdev.flatlaf.IntelliJTheme;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;

import javax.swing.*;
import javax.swing.plaf.FontUIResource;
Expand Down Expand Up @@ -115,21 +102,13 @@ public static void initTheme() {
return;
}

UIManager.put("TitlePane.unifiedBackground", true);

try {
switch (App.config.getTheme()) {
case "BeautyEye":
BeautyEyeLNFHelper.launchBeautyEyeLNF();
UIManager.put("RootPane.setupButtonVisible", false);
break;
case "系统默认":
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
break;
case "weblaf":
case "Darcula":
JFrame.setDefaultLookAndFeelDecorated(false);
JDialog.setDefaultLookAndFeelDecorated(false);
UIManager.setLookAndFeel("com.bulenkov.darcula.DarculaLaf");
break;
case "Flat Light":
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
Expand Down Expand Up @@ -157,6 +136,23 @@ public static void initTheme() {
JDialog.setDefaultLookAndFeelDecorated(true);
}
UIManager.setLookAndFeel("com.formdev.flatlaf.FlatDarculaLaf");
// UIManager.put( "TitlePane.unifiedBackground", true );
/**
If you don't like/want it, you can disable it with:
UIManager.put( "TitlePane.useWindowDecorations", false );
It is also possible to disable only the embedded menu bar (and keep the dark title pane) with:
UIManager.put( "TitlePane.menuBarEmbedded", false );
It is also possible to disable this on command line with following VM options:
-Dflatlaf.useWindowDecorations=false
-Dflatlaf.menuBarEmbedded=false
If you have following code in your app, you can remove it (no longer necessary):
// enable window decorations
JFrame.setDefaultLookAndFeelDecorated( true );
JDialog.setDefaultLookAndFeelDecorated( true );
**/
break;
case "Dark purple":
if (SystemUtil.isJBR()) {
Expand All @@ -183,6 +179,10 @@ public static void initTheme() {
"/theme/Light.theme.json"));
break;

case "BeautyEye":
case "weblaf":
case "Darcula":
case "Darcula(推荐)":
default:
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
Expand Down

0 comments on commit 15f4f09

Please sign in to comment.