Skip to content

Commit

Permalink
3 new splash screens, randomly choose it
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Feb 3, 2022
1 parent 1b44704 commit d123b6f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Orange/canvas/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def onPaletteChange():
app.paletteChanged.connect(onPaletteChange)
onPaletteChange()

def show_splash_message(self, message: str, color=QColor("#FFD39F")):
def show_splash_message(self, message: str, color=QColor("#FFFFFF")):
super().show_splash_message(message, color)

def create_main_window(self):
Expand Down
19 changes: 9 additions & 10 deletions Orange/canvas/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Orange Canvas Configuration
"""
import random
import uuid
import warnings

Expand Down Expand Up @@ -104,33 +105,31 @@ def application_icon():

@staticmethod
def splash_screen():
splash_n = random.randint(1, 3)
path = pkg_resources.resource_filename(
__name__, "icons/orange-splash-screen.png")
__name__, f"icons/orange-splash-screen-{splash_n:02}.png")
pm = QPixmap(path)

version = Config.ApplicationVersion
if version:
version_parsed = LooseVersion(version)
version_comp = version_parsed.version
version = ".".join(map(str, version_comp[:2]))
size = 21 if len(version) < 5 else 16
size = 13
font = QFont("Helvetica")
font.setPixelSize(size)
font.setBold(True)
font.setItalic(True)
font.setLetterSpacing(QFont.AbsoluteSpacing, 2)
metrics = QFontMetrics(font)
br = metrics.boundingRect(version).adjusted(-5, 0, 5, 0)
br.moveCenter(QPoint(436, 224))
br = metrics.boundingRect(version)
br.moveTopLeft(QPoint(171, 438))

p = QPainter(pm)
p.setRenderHint(QPainter.Antialiasing)
p.setRenderHint(QPainter.TextAntialiasing)
p.setFont(font)
p.setPen(QColor("#231F20"))
p.drawText(br, Qt.AlignCenter, version)
p.setPen(QColor("#000000"))
p.drawText(br, Qt.AlignLeft, version)
p.end()
return pm, QRect(88, 193, 200, 20)
return pm, QRect(23, 24, 200, 20)

@staticmethod
def widgets_entry_points():
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Orange/canvas/icons/orange-splash-screen-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Orange/canvas/icons/orange-splash-screen-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Orange/canvas/icons/orange-splash-screen.png
Binary file not shown.

0 comments on commit d123b6f

Please sign in to comment.