From 9cca2f7a2870822dfd8bee0acfdb9e813fa31c03 Mon Sep 17 00:00:00 2001 From: Sebastian Erives Date: Wed, 27 Nov 2024 19:44:25 -0600 Subject: [PATCH] Add taskbar icon api --- .../kotlin/io/github/deltacv/papervision/PaperVision.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PaperVision/src/main/kotlin/io/github/deltacv/papervision/PaperVision.kt b/PaperVision/src/main/kotlin/io/github/deltacv/papervision/PaperVision.kt index 21a6870..6531461 100644 --- a/PaperVision/src/main/kotlin/io/github/deltacv/papervision/PaperVision.kt +++ b/PaperVision/src/main/kotlin/io/github/deltacv/papervision/PaperVision.kt @@ -50,6 +50,8 @@ import io.github.deltacv.papervision.platform.* import io.github.deltacv.papervision.serialization.PaperVisionSerializer import io.github.deltacv.papervision.util.event.PaperVisionEventHandler import io.github.deltacv.papervision.util.loggerForThis +import java.awt.Taskbar +import java.awt.Toolkit class PaperVision( private val setupCall: PlatformSetupCallback @@ -207,6 +209,12 @@ class PaperVision( onInit.run() + if(Taskbar.isTaskbarSupported() && Taskbar.getTaskbar().isSupported(Taskbar.Feature.ICON_IMAGE)) { + Taskbar.getTaskbar().iconImage = Toolkit.getDefaultToolkit().getImage(javaClass.getResource("/ico/ico_ezv.png")) + } else { + logger.warn("Taskbar icon not supported") + } + IdElementContainerStack.threadStack.pop>() IdElementContainerStack.threadStack.pop() IdElementContainerStack.threadStack.pop()