Skip to content

Commit

Permalink
- fix splash screen to show black background on linux and windows
Browse files Browse the repository at this point in the history
  • Loading branch information
derreisende77 committed Oct 24, 2024
1 parent 8c6ab5a commit 54acd1c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/kotlin/mediathek/SplashScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 54acd1c

Please sign in to comment.