mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 20:28:01 -06:00
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:
parent
da6d4e6186
commit
d09f3492db
2 changed files with 11 additions and 7 deletions
|
@ -7,14 +7,21 @@ from PyQt5.QtWidgets import QSplashScreen
|
|||
|
||||
from UM.Resources import Resources
|
||||
from UM.Application import Application
|
||||
from cura import ApplicationMetadata
|
||||
|
||||
|
||||
class CuraSplashScreen(QSplashScreen):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
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._current_message = ""
|
||||
|
@ -52,20 +59,17 @@ class CuraSplashScreen(QSplashScreen):
|
|||
painter.setRenderHint(QPainter.Antialiasing, True)
|
||||
|
||||
version = Application.getInstance().getVersion().split("-")
|
||||
buildtype = Application.getInstance().getBuildType()
|
||||
if buildtype:
|
||||
version[0] += " (%s)" % buildtype
|
||||
|
||||
# Draw version text
|
||||
font = QFont() # Using system-default font here
|
||||
font.setPixelSize(37)
|
||||
font.setPixelSize(18)
|
||||
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:
|
||||
font.setPixelSize(16)
|
||||
painter.setFont(font)
|
||||
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))
|
||||
|
||||
# Draw the loading image
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue