proper dock icon for macOS;
authorwenzelm
Tue, 05 Jan 2021 21:46:35 +0100
changeset 73070 7ef8d77ee761
parent 73069 8d9fb810462b
child 73071 f996348d28ee
proper dock icon for macOS;
lib/logo/isabelle_transparent-128.png
src/Pure/Admin/build_release.scala
src/Pure/GUI/gui.scala
src/Tools/jEdit/src-base/plugin.scala
Binary file lib/logo/isabelle_transparent-128.png has changed
--- a/src/Pure/Admin/build_release.scala	Tue Jan 05 20:53:57 2021 +0100
+++ b/src/Pure/Admin/build_release.scala	Tue Jan 05 21:46:35 2021 +0100
@@ -305,8 +305,6 @@
 <dict>
 <key>CFBundleDevelopmentRegion</key>
 <string>English</string>
-<key>CFBundleIconFile</key>
-<string>isabelle.icns</string>
 <key>CFBundleIdentifier</key>
 <string>de.tum.in.isabelle.""" + isabelle_name + """</string>
 <key>CFBundleDisplayName</key>
@@ -340,8 +338,6 @@
 <array>
 <string>thy</string>
 </array>
-<key>CFBundleTypeIconFile</key>
-<string>theory.icns</string>
 <key>CFBundleTypeName</key>
 <string>Isabelle theory file</string>
 <key>CFBundleTypeRole</key>
--- a/src/Pure/GUI/gui.scala	Tue Jan 05 20:53:57 2021 +0100
+++ b/src/Pure/GUI/gui.scala	Tue Jan 05 21:46:35 2021 +0100
@@ -157,6 +157,21 @@
 
   def isabelle_image(): Image = isabelle_icon().getImage
 
+  def isabelle_image_large(): Image =
+    Toolkit.getDefaultToolkit.getImage(
+      File.platform_path(Path.explode("~~/lib/logo/isabelle_transparent-128.png")))
+
+  def set_application_icon()
+  {
+    if (Platform.is_macos) {
+      val image = isabelle_image_large()
+      val app =
+        Class.forName("com.apple.eawt.Application")
+          .getDeclaredMethod("getApplication").invoke(null)
+      app.getClass.getDeclaredMethod("setDockIconImage", classOf[Image]).invoke(app, image)
+    }
+  }
+
 
   /* location within multi-screen environment */
 
--- a/src/Tools/jEdit/src-base/plugin.scala	Tue Jan 05 20:53:57 2021 +0100
+++ b/src/Tools/jEdit/src-base/plugin.scala	Tue Jan 05 21:46:35 2021 +0100
@@ -19,6 +19,8 @@
   {
     Isabelle_System.init()
 
+    GUI.set_application_icon()
+
     Debug.DISABLE_SEARCH_DIALOG_POOL = true
 
     Syntax_Style.dummy_style_extender()