Add enterprise splash screen.

Added it as a png, which might be a bit overkill but it could also
could be hard getting strokes / shadows exactly right otherwise. Also
Allows for more visual distinction of the background later

CURA-7011
This commit is contained in:
Nino van Hooff 2019-12-10 15:59:57 +01:00
parent da6d4e6186
commit d09f3492db
2 changed files with 11 additions and 7 deletions

View file

@ -7,14 +7,21 @@ from PyQt5.QtWidgets import QSplashScreen
from UM.Resources import Resources from UM.Resources import Resources
from UM.Application import Application from UM.Application import Application
from cura import ApplicationMetadata
class CuraSplashScreen(QSplashScreen): class CuraSplashScreen(QSplashScreen):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self._scale = 0.7 self._scale = 0.7
self._version_y_offset = 0 # when extra visual elements are in the background image, move version text down
if ApplicationMetadata.IsEnterpriseVersion:
splash_image = QPixmap(Resources.getPath(Resources.Images, "cura_enterprise.png"))
self._version_y_offset = 32
else:
splash_image = QPixmap(Resources.getPath(Resources.Images, "cura.png")) splash_image = QPixmap(Resources.getPath(Resources.Images, "cura.png"))
self.setPixmap(splash_image) self.setPixmap(splash_image)
self._current_message = "" self._current_message = ""
@ -52,20 +59,17 @@ class CuraSplashScreen(QSplashScreen):
painter.setRenderHint(QPainter.Antialiasing, True) painter.setRenderHint(QPainter.Antialiasing, True)
version = Application.getInstance().getVersion().split("-") version = Application.getInstance().getVersion().split("-")
buildtype = Application.getInstance().getBuildType()
if buildtype:
version[0] += " (%s)" % buildtype
# Draw version text # Draw version text
font = QFont() # Using system-default font here font = QFont() # Using system-default font here
font.setPixelSize(37) font.setPixelSize(18)
painter.setFont(font) painter.setFont(font)
painter.drawText(60, 66, 330 * self._scale, 230 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[0]) painter.drawText(60, 66 + self._version_y_offset, 330 * self._scale, 230 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[0])
if len(version) > 1: if len(version) > 1:
font.setPixelSize(16) font.setPixelSize(16)
painter.setFont(font) painter.setFont(font)
painter.setPen(QColor(200, 200, 200, 255)) painter.setPen(QColor(200, 200, 200, 255))
painter.drawText(247, 105, 330 * self._scale, 255 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[1]) painter.drawText(247, 105 + self._version_y_offset, 330 * self._scale, 255 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[1])
painter.setPen(QColor(255, 255, 255, 255)) painter.setPen(QColor(255, 255, 255, 255))
# Draw the loading image # Draw the loading image

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB