From 54acd1cd05b0c0573690066e54a4f721fb4496e1 Mon Sep 17 00:00:00 2001 From: "Christian F." Date: Thu, 24 Oct 2024 11:27:00 +0200 Subject: [PATCH] - fix splash screen to show black background on linux and windows --- src/main/kotlin/mediathek/SplashScreen.kt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/mediathek/SplashScreen.kt b/src/main/kotlin/mediathek/SplashScreen.kt index c66d5db904..d47128c2ef 100644 --- a/src/main/kotlin/mediathek/SplashScreen.kt +++ b/src/main/kotlin/mediathek/SplashScreen.kt @@ -4,6 +4,7 @@ import mediathek.config.Konstanten import mediathek.tool.TimerPool.timerPool import mediathek.tool.UIProgressState import org.apache.commons.lang3.SystemUtils +import org.jdesktop.swingx.StackLayout import java.awt.Color import java.awt.Cursor import java.awt.Dimension @@ -20,6 +21,9 @@ class SplashScreen : JWindow() { private val imageLabel = JLabel() private val progressBar = JProgressBar() private val statusLabel = JLabel() + private val bgPanel = JPanel() + private val contentPane_top = JPanel() + init { initComponents() @@ -64,6 +68,7 @@ class SplashScreen : JWindow() { * @param percentComplete The new percentage. */ private fun updateStatus(statusText: String?, percentComplete: Int) { + bgPanel.paintImmediately(0,0, width, height) appTitleLabel.paintImmediately(0, 0, appTitleLabel.width, appTitleLabel.height) imageLabel.paintImmediately(0, 0, imageLabel.width, imageLabel.height) versionLabel.paintImmediately(0, 0, versionLabel.width, versionLabel.height) @@ -100,8 +105,16 @@ class SplashScreen : JWindow() { statusLabel.foreground = Color.white statusLabel.background = Color.black statusLabel.isOpaque = true - val contentPaneLayout = GroupLayout(contentPane) - contentPane.layout = contentPaneLayout + val stackPanel = JPanel(StackLayout()) + contentPane = stackPanel + + bgPanel.background = Color.black + contentPane_top.background = Color.black + stackPanel.add(bgPanel, StackLayout.BOTTOM) + stackPanel.add(contentPane_top, StackLayout.TOP) + + val contentPaneLayout = GroupLayout(contentPane_top) + contentPane_top.layout = contentPaneLayout contentPaneLayout.setHorizontalGroup( contentPaneLayout.createParallelGroup() .addGroup(