Repository: spyder-ide/spyder

Issue:
New Splash Screen misbehaves on dark backgrounds
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

## Problem Description

When one has a dark background (the darker the more noticeable), and one starts spyder, the splash screen has an annoying "jump" at the left side of the image as illustrated below :

![new_spyder_splash_on_dark_background](https://user-images.githubusercontent.com/3516972/129915603-19fcf7b0-9ac1-40ba-9e3b-49741460a50f.png)

### What is the expected output?
Same behavior as at the right side of the image

## Versions
```
* Spyder version: 5.1.1 None
* Python version: 3.9.6 64-bit
* Qt version: 5.12.9
* PyQt5 version: 5.12.3
* Operating System: Linux 5.11.0-27-generic
```
## Dependencies
```

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.0.2 (OK)
IPython >=7.6.0               :  7.26.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.0 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.0.1 (OK)
nbconvert >=4.0               :  6.1.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
parso >=0.7.0;<0.9.0          :  0.8.2 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.9.0 (OK)
pylint >=2.5.0                :  2.9.6 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.2.1;<1.3.0          :  1.2.1 (OK)
pylsp_black >=1.0.0           :  None (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.0.3 (OK)
qtconsole >=5.1.0             :  5.1.1 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  49.6.0.post20210108 (OK)
sphinx >=0.6.6                :  4.1.2 (OK)
spyder_kernels >=2.1.0;<2.2.0 :  2.1.0 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.3 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  22.2.0 (OK)

# Optional:
cython >=0.21                 :  0.29.24 (OK)
matplotlib >=2.0.0            :  3.4.2 (OK)
numpy >=1.7                   :  1.21.1 (OK)
pandas >=1.1.1                :  1.3.1 (OK)
scipy >=0.17.0                :  1.7.1 (OK)
sympy >=0.7.3                 :  1.8 (OK)
```



Discussion:

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -49,7 +49,7 @@
 from qtpy.compat import from_qvariant
 from qtpy.QtCore import (QCoreApplication, Qt, QTimer, Signal, Slot,
                          qInstallMessageHandler)
-from qtpy.QtGui import QColor, QKeySequence
+from qtpy.QtGui import QColor, QKeySequence, QIcon
 from qtpy.QtWidgets import (QAction, QApplication, QMainWindow, QMenu,
                             QMessageBox, QShortcut, QStyleFactory, QCheckBox)
 
@@ -543,6 +543,10 @@ def __init__(self, splash=None, options=None):
         # Enabling scaling for high dpi
         qapp.setAttribute(Qt.AA_UseHighDpiPixmaps)
 
+        # Set Windows app icon to use .ico file
+        if os.name == "nt":
+            qapp.setWindowIcon(ima.get_icon("windows_app_icon"))
+
         self.default_style = str(qapp.style().objectName())
 
         self.init_workdir = options.working_directory
diff --git a/spyder/app/utils.py b/spyder/app/utils.py
--- a/spyder/app/utils.py
+++ b/spyder/app/utils.py
@@ -17,8 +17,9 @@
 # Third-party imports
 import psutil
 from qtpy.QtCore import QCoreApplication, Qt
-from qtpy.QtGui import QColor, QIcon, QPalette, QPixmap
+from qtpy.QtGui import QColor, QIcon, QPalette, QPixmap, QPainter, QImage
 from qtpy.QtWidgets import QApplication, QSplashScreen
+from qtpy.QtSvg import QSvgRenderer
 
 # Local imports
 from spyder.config.base import (
@@ -178,9 +179,17 @@ def qt_message_handler(msg_type, msg_log_context, msg_string):
 def create_splash_screen():
     """Create splash screen."""
     if not running_under_pytest():
-        pixmap = QPixmap(get_image_path('splash'))
-        splash = QSplashScreen(
-            pixmap.scaledToWidth(500, Qt.SmoothTransformation))
+        image = QImage(500, 400, QImage.Format_ARGB32_Premultiplied)
+        image.fill(0)
+        painter = QPainter(image)
+        renderer = QSvgRenderer(get_image_path('splash'))
+        renderer.render(painter)
+        painter.end()
+
+        pm = QPixmap.fromImage(image)
+        pm = pm.copy(0, 0, 500, 400)
+
+        splash = QSplashScreen(pm)
         splash_font = splash.font()
         splash_font.setPixelSize(14)
         splash.setFont(splash_font)


Test patch: