Skip to content
Snippets Groups Projects
Commit 6287143f authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

#173 - Set icon of native content player window

parent 6ba353d4
No related branches found
No related tags found
No related merge requests found
Showing
with 27 additions and 2 deletions
......@@ -4,6 +4,7 @@ import de.thecodelabs.logger.Logger;
import de.thecodelabs.utils.application.App;
import de.thecodelabs.utils.application.ApplicationUtils;
import de.thecodelabs.utils.io.FileUtils;
import de.thecodelabs.utils.io.IOUtils;
import de.thecodelabs.utils.threading.Worker;
import de.thecodelabs.utils.ui.NVC;
import de.thecodelabs.utils.util.SystemUtils;
......@@ -35,6 +36,8 @@ import javafx.stage.Window;
import org.dom4j.DocumentException;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
......@@ -54,6 +57,8 @@ public class PlayPadImpl implements PlayPad {
private MainViewController mainViewController;
private Image stageIcon;
private byte[] stageIconData;
private Project currentProject;
private final Module module;
......@@ -281,8 +286,18 @@ public class PlayPadImpl implements PlayPad {
return stageIcon;
}
public void setIcon(Image icon) {
@Override
public byte[] getIconData() {
return stageIconData;
}
public void setIcon(Image icon, InputStream iconResource) {
this.stageIcon = icon;
try {
stageIconData = IOUtils.inputStreamToByteArray(iconResource);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
public Module getModule() {
......
......@@ -105,7 +105,7 @@ public class PlayPadMain extends Application {
Image stageIcon = new Image(ICON_PATH);
Alerts.getInstance().setDefaultIcon(stageIcon);
impl.setIcon(stageIcon);
impl.setIcon(stageIcon, getClass().getClassLoader().getResourceAsStream(ICON_PATH));
PlayPadPlugin.setStyleable(new ModernStyleableImpl());
impl.setModernDesign(new ModernDesignHandlerImpl());
......
......@@ -107,6 +107,13 @@ public interface PlayPad {
*/
Image getIcon();
/**
* Gibt das Programm Icon als byte[] zurück.
*
* @return Icon
*/
byte[] getIconData();
/**
* Beendet PlayWall.
*/
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
package de.tobias.playpad.plugin.content.player
import de.tobias.playpad.PlayPadPlugin
import de.tobias.playpad.plugin.content.pad.ContentPlayerMediaContainer
import de.tobias.playpad.plugin.content.settings.{Zone, ZoneConfiguration}
import nativecontentplayerwindows.{ContentPlayer, ContentPlayerWindow}
......@@ -11,6 +12,8 @@ class ContentPlayerWindowController {
val window: ContentPlayerWindow = new ContentPlayerWindow()
val players: ListBuffer[ContentPlayerBinding] = ListBuffer.empty
window.SetIcon(PlayPadPlugin.getInstance.getIconData)
def configurePlayers(configuration: ZoneConfiguration): Unit = {
if (configuration.zones.isEmpty) {
window.Close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment