瀏覽代碼

OS X related stuff (issue 954)


git-svn-id: http://svn.dmdirc.com/trunk@3570 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 年之前
父節點
當前提交
1aa1e94da0
共有 2 個檔案被更改,包括 28 行新增11 行删除
  1. 5
    4
      launcher/osx/DMDirc.sh
  2. 23
    7
      src/com/dmdirc/ui/swing/SwingController.java

+ 5
- 4
launcher/osx/DMDirc.sh 查看文件

@@ -242,10 +242,11 @@ if [ -e "${jar}" ]; then
242 242
 	# to be seen, and the shell script exits with the correct exit code.
243 243
 	
244 244
 	APPLEOPTS=""
245
-	APPLEOPTS="${APPLEOPTS} -Dcom.apple.mrj.application.growbox.intrudes=false"
246
-	APPLEOPTS="${APPLEOPTS} -Dcom.apple.mrj.application.live-resize=true"
247
-	APPLEOPTS="${APPLEOPTS} -Dcom.apple.mrj.application.apple.menu.about.name=DMDirc"
248
-	APPLEOPTS="${APPLEOPTS} -Dapple.laf.useScreenMenuBar=true"
245
+#	APPLEOPTS="${APPLEOPTS} -Dcom.apple.mrj.application.growbox.intrudes=false"
246
+#	APPLEOPTS="${APPLEOPTS} -Dcom.apple.mrj.application.live-resize=true"
247
+#	APPLEOPTS="${APPLEOPTS} -Dcom.apple.mrj.application.apple.menu.about.name=DMDirc"
248
+#	APPLEOPTS="${APPLEOPTS} -Dapple.awt.showGrowBox=true"
249
+#	APPLEOPTS="${APPLEOPTS} -Dapple.laf.useScreenMenuBar=true"
249 250
 	
250 251
 	${JAVA}${APPLEOPTS} -ea -jar ${jar} -l osx-${LAUNCHERVERSION} ${params}
251 252
 	exit $?;

+ 23
- 7
src/com/dmdirc/ui/swing/SwingController.java 查看文件

@@ -264,6 +264,29 @@ public final class SwingController implements UIController {
264 264
             System.setProperty("awt.useSystemAAFontSettings", "true");
265 265
             System.setProperty("swing.aatext", "true");
266 266
         }
267
+        
268
+        if (System.getProperty("os.name").startsWith("Mac OS")) {
269
+            // Set some Apple OS X related stuff from
270
+            // http://developer.apple.com/documentation/Java/Conceptual/JavaPropVMInfoRef/Articles/JavaSystemProperties.html
271
+            final String aaText = 
272
+                System.getProperty("swing.aatext").equalsIgnoreCase("true") ?
273
+                "on" : "off";
274
+            final String aaSetting =
275
+                    IdentityManager.getGlobalConfig().getOption("ui",
276
+                    "antialias");
277
+            if (aaSetting.equalsIgnoreCase("true")) {
278
+                System.setProperty("apple.awt.antialiasing", "on");
279
+            } else {
280
+                System.setProperty("apple.awt.antialiasing", "off");
281
+            }
282
+            System.setProperty("apple.awt.textantialiasing", aaText);
283
+            System.setProperty("apple.awt.showGrowBox", "true");
284
+            System.setProperty("apple.laf.useScreenMenuBar", "true");
285
+            System.setProperty("com.apple.mrj.application.apple.menu.about.name",
286
+                    "DMDirc: " + Main.VERSION);
287
+            System.setProperty("com.apple.mrj.application.growbox.intrudes", "false");
288
+            System.setProperty("com.apple.mrj.application.live-resize", "true");
289
+        }
267 290
 
268 291
         try {
269 292
             UIUtilities.initUISettings();
@@ -291,13 +314,6 @@ public final class SwingController implements UIController {
291 314
             UIManager.put("Tree.expandedIcon",
292 315
                     IconManager.getIconManager().getIcon("nothing"));
293 316
 
294
-            //These are likely to change lots, and i cant test them - Greboid
295
-            UIManager.put("apple.awt.showGrowBox", true);
296
-            UIManager.put("apple.laf.useScreenMenuBar", true);
297
-            UIManager.put("com.apple.mrj.application.apple.menu.about.name",
298
-                    "DMDirc: " + Main.VERSION);
299
-            UIManager.put("com.apple.mrj.application.growbox.intrudes", false);
300
-            UIManager.put("com.apple.mrj.application.live-resize", true);
301 317
         } catch (UnsupportedOperationException ex) {
302 318
             Logger.userError(ErrorLevel.LOW, "Unable to set UI Settings");
303 319
         } catch (UnsupportedLookAndFeelException ex) {

Loading…
取消
儲存