Skip to content

Commit

Permalink
Merge pull request #5814 from markotoplak/new-cgp
Browse files Browse the repository at this point in the history
[ENH] New icons and splash screen
  • Loading branch information
markotoplak authored Feb 7, 2022
2 parents d545b38 + d123b6f commit c38b96f
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 188 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
21 changes: 10 additions & 11 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 @@ -98,39 +99,37 @@ def application_icon():
Return the main application icon.
"""
path = pkg_resources.resource_filename(
__name__, "icons/orange-canvas.svg"
__name__, "icons/orange-256.png"
)
return QIcon(path)

@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
Binary file added Orange/canvas/icons/orange-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 0 additions & 88 deletions Orange/canvas/icons/orange-canvas.svg

This file was deleted.

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.
Binary file modified Orange/canvas/icons/orange.ico
Binary file not shown.
Binary file modified distribute/icon-256.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 modified distribute/icon-48.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 distribute/orange-canvas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 0 additions & 88 deletions distribute/orange-canvas.svg

This file was deleted.

0 comments on commit c38b96f

Please sign in to comment.