mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 14:55:03 -06:00
Merge pull request #571 from Ultimaker/feature_ux2-1_update
Updated Design rework for 2.1 release
This commit is contained in:
commit
9544602df5
18 changed files with 276 additions and 280 deletions
|
@ -1,8 +1,8 @@
|
|||
# Copyright (c) 2015 Ultimaker B.V.
|
||||
# Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QPixmap, QColor, QFont
|
||||
from PyQt5.QtCore import Qt, QCoreApplication
|
||||
from PyQt5.QtGui import QPixmap, QColor, QFont, QFontMetrics
|
||||
from PyQt5.QtWidgets import QSplashScreen
|
||||
|
||||
from UM.Resources import Resources
|
||||
|
@ -11,7 +11,10 @@ from UM.Application import Application
|
|||
class CuraSplashScreen(QSplashScreen):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setPixmap(QPixmap(Resources.getPath(Resources.Images, "cura.png")))
|
||||
self._scale = round(QFontMetrics(QCoreApplication.instance().font()).ascent() / 12)
|
||||
|
||||
splash_image = QPixmap(Resources.getPath(Resources.Images, "cura.png"))
|
||||
self.setPixmap(splash_image.scaled(splash_image.size() * self._scale))
|
||||
|
||||
def drawContents(self, painter):
|
||||
painter.save()
|
||||
|
@ -19,11 +22,11 @@ class CuraSplashScreen(QSplashScreen):
|
|||
|
||||
version = Application.getInstance().getVersion().split("-")
|
||||
|
||||
painter.setFont(QFont("Proxima Nova Rg", 20))
|
||||
painter.drawText(0, 0, 203, 230, Qt.AlignRight | Qt.AlignBottom, version[0])
|
||||
painter.setFont(QFont("Proxima Nova Rg", 20 ))
|
||||
painter.drawText(0, 0, 330 * self._scale, 230 * self._scale, Qt.AlignHCenter | Qt.AlignBottom, version[0])
|
||||
if len(version) > 1:
|
||||
painter.setFont(QFont("Proxima Nova Rg", 12))
|
||||
painter.drawText(0, 0, 203, 255, Qt.AlignRight | Qt.AlignBottom, version[1])
|
||||
painter.setFont(QFont("Proxima Nova Rg", 12 ))
|
||||
painter.drawText(0, 0, 330 * self._scale, 255 * self._scale, Qt.AlignHCenter | Qt.AlignBottom, version[1])
|
||||
|
||||
painter.restore()
|
||||
super().drawContents(painter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue