mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 01:50:44 +01:00
set frame icon images for Java2D (dock and cmd-tab)
This commit is contained in:
@@ -988,6 +988,12 @@ public class PSurfaceAWT extends PSurfaceNone {
|
||||
frame.setIconImages(iconImages);
|
||||
|
||||
} catch (Exception e) { } // harmless; keep this to ourselves
|
||||
|
||||
} else {
|
||||
// On OS X, set this for AWT surfaces, which handles the dock image
|
||||
// as well as the cmd-tab image that's shown. Just one size, I guess.
|
||||
URL url = PApplet.class.getResource("/icon/icon-512.png");
|
||||
ThinkDifferent.setIconImage(Toolkit.getDefaultToolkit().getImage(url));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
package processing.core;
|
||||
|
||||
import java.awt.Image;
|
||||
|
||||
import com.apple.eawt.AppEvent.QuitEvent;
|
||||
import com.apple.eawt.Application;
|
||||
import com.apple.eawt.QuitHandler;
|
||||
@@ -118,4 +120,9 @@ public class ThinkDifferent {
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
static void setIconImage(Image image) {
|
||||
application.setDockIconImage(image);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user