fix(ui): scale splash screen with screen width

This commit is contained in:
Travis Abendshien
2024-09-02 00:32:36 -07:00
parent ca08ce57b6
commit 1e4883c577

View File

@@ -292,8 +292,18 @@ class QtDriver(QObject):
splash_pixmap = QPixmap(":/images/splash.png")
splash_pixmap.setDevicePixelRatio(self.main_window.devicePixelRatio())
splash_pixmap = splash_pixmap.scaledToWidth(
min(
(
QGuiApplication.primaryScreen().geometry().width()
* self.main_window.devicePixelRatio()
)
// 4,
splash_pixmap.width(),
),
Qt.TransformationMode.SmoothTransformation,
)
self.splash = QSplashScreen(splash_pixmap, Qt.WindowStaysOnTopHint) # type: ignore
# self.splash.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
self.splash.show()
if os.name == "nt":