Updated splash screen with current year & assembly version

This commit is contained in:
IgorTimofeev
2022-09-19 15:56:48 +03:00
parent 696002795a
commit c2fbcc6027

View File

@@ -1,13 +1,10 @@
package ocelot.desktop.ui.swing
import java.awt.Window.Type
import java.awt.image.ImageObserver.HEIGHT
import java.awt.{Color, Dimension, Insets, Rectangle}
import java.time.Year
import javax.swing.border.{CompoundBorder, EmptyBorder}
import javax.swing.{JDialog, JLabel, JPanel, SwingConstants}
import javax.swing.border.Border
import javax.swing.border.CompoundBorder
import javax.swing.border.EmptyBorder
class SplashScreen extends JDialog {
val Width = 750
@@ -17,10 +14,12 @@ class SplashScreen extends JDialog {
private def addLabel(rectangle: Rectangle, text: String, horizontalAlignment: Int = SwingConstants.LEFT, verticalAlignment: Int = SwingConstants.TOP): JLabel = {
val label = new JLabel(text)
label.setForeground(Color.white)
label.setBounds(rectangle)
label.setHorizontalAlignment(horizontalAlignment)
label.setVerticalAlignment(verticalAlignment)
panel.add(label)
label
@@ -43,7 +42,7 @@ class SplashScreen extends JDialog {
// Status
private val status: JLabel = addLabel(new Rectangle(322, 390, 300, 100), "Starting Ocelot...")
// Copyright label
// Copyright
private val copyright: JLabel = addLabel(
new Rectangle(0, 0, Width, Height),
s"© 2018 - ${Year.now.getValue} Ocelot Dev Team",
@@ -53,7 +52,7 @@ class SplashScreen extends JDialog {
setLabelMargin(copyright, new Insets(0, 0, 20, 20))
// ProgressBar
// Progress bar
private val progressBar = new ColoredPanel(Color.white)
panel.add(progressBar)