1818import com .fangxuele .tool .push .ui .form .PushHisForm ;
1919import com .fangxuele .tool .push .ui .form .ScheduleForm ;
2020import com .fangxuele .tool .push .ui .form .SettingForm ;
21- import com .fangxuele .tool .push .ui .form .UserCaseForm ;
2221import com .fangxuele .tool .push .ui .listener .AboutListener ;
2322import com .fangxuele .tool .push .util .SystemUtil ;
2423import com .fangxuele .tool .push .util .UIUtil ;
@@ -53,7 +52,7 @@ public class Init {
5352 /**
5453 * 字号初始化KEY
5554 */
56- private static final String FONT_SIZE_INIT_PROP = "fontSizeInit" ;
55+ public static final String FONT_SIZE_INIT_PROP = "fontSizeInit" ;
5756
5857 /**
5958 * 设置全局字体
@@ -74,6 +73,7 @@ public static void initGlobalFont() {
7473 fontSize = (int ) (UIUtil .getScreenScale () * fontSize );
7574 }
7675 App .config .setFontSize (fontSize );
76+ App .config .save ();
7777 }
7878
7979 Font font = new Font (App .config .getFont (), Font .PLAIN , App .config .getFontSize ());
@@ -100,7 +100,7 @@ public static void initOthers() {
100100 * 初始化look and feel
101101 */
102102 public static void initTheme () {
103- if (SystemUtil .isMacM1 ()) {
103+ if (SystemUtil .isMacM1 () || SystemUtil . isLinuxOs () ) {
104104 try {
105105 UIManager .setLookAndFeel ("com.formdev.flatlaf.FlatDarculaLaf" );
106106 logger .warn ("FlatDarculaLaf theme set." );
@@ -125,35 +125,69 @@ public static void initTheme() {
125125 UIManager .setLookAndFeel (UIManager .getSystemLookAndFeelClassName ());
126126 break ;
127127 case "weblaf" :
128- case "Darcula(推荐)" :
128+ case "Darcula" :
129+ JFrame .setDefaultLookAndFeelDecorated (false );
130+ JDialog .setDefaultLookAndFeelDecorated (false );
129131 UIManager .setLookAndFeel ("com.bulenkov.darcula.DarculaLaf" );
130132 break ;
131133 case "Flat Light" :
134+ if (SystemUtil .isJBR ()) {
135+ JFrame .setDefaultLookAndFeelDecorated (true );
136+ JDialog .setDefaultLookAndFeelDecorated (true );
137+ }
132138 FlatLightLaf .install ();
133139 break ;
134140 case "Flat IntelliJ" :
141+ if (SystemUtil .isJBR ()) {
142+ JFrame .setDefaultLookAndFeelDecorated (true );
143+ JDialog .setDefaultLookAndFeelDecorated (true );
144+ }
135145 UIManager .setLookAndFeel ("com.formdev.flatlaf.FlatIntelliJLaf" );
136146 break ;
137147 case "Flat Dark" :
148+ if (SystemUtil .isJBR ()) {
149+ JFrame .setDefaultLookAndFeelDecorated (true );
150+ JDialog .setDefaultLookAndFeelDecorated (true );
151+ }
138152 UIManager .setLookAndFeel ("com.formdev.flatlaf.FlatDarkLaf" );
139153 break ;
140- case "Flat Darcula" :
154+ case "Flat Darcula(推荐)" :
155+ if (SystemUtil .isJBR ()) {
156+ JFrame .setDefaultLookAndFeelDecorated (true );
157+ JDialog .setDefaultLookAndFeelDecorated (true );
158+ }
141159 UIManager .setLookAndFeel ("com.formdev.flatlaf.FlatDarculaLaf" );
142160 break ;
143161 case "Dark purple" :
162+ if (SystemUtil .isJBR ()) {
163+ JFrame .setDefaultLookAndFeelDecorated (true );
164+ JDialog .setDefaultLookAndFeelDecorated (true );
165+ }
144166 IntelliJTheme .install (App .class .getResourceAsStream (
145167 "/theme/DarkPurple.theme.json" ));
146168 break ;
147169 case "IntelliJ Cyan" :
170+ if (SystemUtil .isJBR ()) {
171+ JFrame .setDefaultLookAndFeelDecorated (true );
172+ JDialog .setDefaultLookAndFeelDecorated (true );
173+ }
148174 IntelliJTheme .install (App .class .getResourceAsStream (
149175 "/theme/Cyan.theme.json" ));
150176 break ;
151177 case "IntelliJ Light" :
178+ if (SystemUtil .isJBR ()) {
179+ JFrame .setDefaultLookAndFeelDecorated (true );
180+ JDialog .setDefaultLookAndFeelDecorated (true );
181+ }
152182 IntelliJTheme .install (App .class .getResourceAsStream (
153183 "/theme/Light.theme.json" ));
154184 break ;
155185
156186 default :
187+ if (SystemUtil .isJBR ()) {
188+ JFrame .setDefaultLookAndFeelDecorated (true );
189+ JDialog .setDefaultLookAndFeelDecorated (true );
190+ }
157191 UIManager .setLookAndFeel ("com.formdev.flatlaf.FlatDarculaLaf" );
158192 }
159193 } catch (Exception e ) {
@@ -168,7 +202,7 @@ public static void initAllTab() {
168202 ThreadUtil .execute (AboutForm ::init );
169203 MessageTypeForm .init ();
170204 ThreadUtil .execute (HelpForm ::init );
171- ThreadUtil .execute (UserCaseForm ::init );
205+ // ThreadUtil.execute(UserCaseForm::init);
172206 ThreadUtil .execute (() -> MessageEditForm .init (null ));
173207 ThreadUtil .execute (MessageManageForm ::init );
174208 ThreadUtil .execute (MemberForm ::init );
@@ -191,7 +225,7 @@ public static void initAllTab() {
191225 /**
192226 * 引导用户调整字号
193227 */
194- public static void initFontSize () {
228+ public static void fontSizeGuide () {
195229 if (StringUtils .isEmpty (App .config .getProps (FONT_SIZE_INIT_PROP ))) {
196230 FontSizeAdjustDialog fontSizeAdjustDialog = new FontSizeAdjustDialog ();
197231 fontSizeAdjustDialog .pack ();
0 commit comments