mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 04:15:12 +08:00
Merge pull request #6787 from Ultimaker/CURA-7011_enterprise_visual_cues
CURA-7011_enterprise_visual_cues
This commit is contained in:
commit
e2e9d2a307
@ -22,13 +22,6 @@ try:
|
||||
except ImportError:
|
||||
CuraAppName = DEFAULT_CURA_APP_NAME
|
||||
|
||||
try:
|
||||
from cura.CuraVersion import CuraAppDisplayName # type: ignore
|
||||
if CuraAppDisplayName == "":
|
||||
CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME
|
||||
except ImportError:
|
||||
CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME
|
||||
|
||||
try:
|
||||
from cura.CuraVersion import CuraVersion # type: ignore
|
||||
if CuraVersion == "":
|
||||
@ -53,3 +46,13 @@ except ImportError:
|
||||
# Various convenience flags indicating what kind of Cura build it is.
|
||||
__ENTERPRISE_VERSION_TYPE = "enterprise"
|
||||
IsEnterpriseVersion = CuraBuildType.lower() == __ENTERPRISE_VERSION_TYPE
|
||||
|
||||
try:
|
||||
from cura.CuraVersion import CuraAppDisplayName # type: ignore
|
||||
if CuraAppDisplayName == "":
|
||||
CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME
|
||||
if IsEnterpriseVersion:
|
||||
CuraAppDisplayName = CuraAppDisplayName + " Enterprise"
|
||||
|
||||
except ImportError:
|
||||
CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME
|
||||
|
@ -170,7 +170,7 @@ class CuraApplication(QtApplication):
|
||||
app_display_name = ApplicationMetadata.CuraAppDisplayName,
|
||||
version = ApplicationMetadata.CuraVersion,
|
||||
api_version = ApplicationMetadata.CuraSDKVersion,
|
||||
buildtype = ApplicationMetadata.CuraBuildType,
|
||||
build_type = ApplicationMetadata.CuraBuildType,
|
||||
is_debug_mode = ApplicationMetadata.CuraDebugMode,
|
||||
tray_icon_name = "cura-icon-32.png",
|
||||
**kwargs)
|
||||
|
@ -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 = 26
|
||||
else:
|
||||
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, 70 + 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
|
||||
|
BIN
resources/images/cura_enterprise.png
Normal file
BIN
resources/images/cura_enterprise.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
@ -12,7 +12,7 @@ UM.Dialog
|
||||
id: base
|
||||
|
||||
//: About dialog title
|
||||
title: catalog.i18nc("@title:window","About Cura")
|
||||
title: catalog.i18nc("@title:window","About " + catalog.i18nc("@title:window", CuraApplication.applicationDisplayName))
|
||||
|
||||
minimumWidth: 500 * screenScaleFactor
|
||||
minimumHeight: 650 * screenScaleFactor
|
||||
|
Loading…
x
Reference in New Issue
Block a user