Skip to content

Commit

Permalink
- WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
derreisende77 committed Oct 24, 2024
1 parent 630f93e commit 86a4b43
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/main/kotlin/mediathek/SplashScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ class SplashScreen : JWindow() {
private val imageLabel = JLabel()
private val progressBar = JProgressBar()
private val statusLabel = JLabel()
private val bgPanel = JPanel()
private val contentPane_top = JPanel()
private val stackPanel = JPanel(StackLayout())


/**
* Needed for linux and windows where AWT doesnt seem to be able to properly draw JWindow black background anymore :(
*/
private val backgroundPanel = JPanel()
private val splashContent = JPanel()


init {
Expand Down Expand Up @@ -69,7 +75,7 @@ class SplashScreen : JWindow() {
*/
private fun updateStatus(statusText: String?, percentComplete: Int) {
if (!SystemUtils.IS_OS_MAC_OSX)
bgPanel.paintImmediately(0,0, width, height)
backgroundPanel.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 @@ -106,16 +112,16 @@ class SplashScreen : JWindow() {
statusLabel.foreground = Color.white
statusLabel.background = Color.black
statusLabel.isOpaque = true
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)
backgroundPanel.background = Color.black
splashContent.background = Color.black

stackPanel.add(backgroundPanel, StackLayout.BOTTOM)
stackPanel.add(splashContent, StackLayout.TOP)
contentPane = stackPanel

val contentPaneLayout = GroupLayout(contentPane_top)
contentPane_top.layout = contentPaneLayout
val contentPaneLayout = GroupLayout(splashContent)
splashContent.layout = contentPaneLayout
contentPaneLayout.setHorizontalGroup(
contentPaneLayout.createParallelGroup()
.addGroup(
Expand Down

0 comments on commit 86a4b43

Please sign in to comment.