Use a transparent image for the welcome dialog

This commit is contained in:
Veronica Berglyd Olsen
2025-06-04 20:37:30 +02:00
parent c63336ade4
commit 8ce6c678aa
5 changed files with 3 additions and 4 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 KiB

+1 -1
View File
@@ -634,7 +634,7 @@ class GuiIcons:
"unfold": ("unfold-show", "unfold-hide"), "unfold": ("unfold-show", "unfold-hide"),
} }
IMAGE_MAP: Final[dict[str, tuple[str, str]]] = { IMAGE_MAP: Final[dict[str, tuple[str, str]]] = {
"welcome": ("welcome-light.jpg", "welcome-dark.jpg"), "welcome": ("welcome.webp", "welcome.webp"),
"nw-text": ("novelwriter-text-light.svg", "novelwriter-text-dark.svg"), "nw-text": ("novelwriter-text-light.svg", "novelwriter-text-dark.svg"),
} }
+2 -3
View File
@@ -32,7 +32,7 @@ from PyQt6.QtCore import (
QAbstractListModel, QModelIndex, QObject, QPoint, QSize, Qt, pyqtSignal, QAbstractListModel, QModelIndex, QObject, QPoint, QSize, Qt, pyqtSignal,
pyqtSlot pyqtSlot
) )
from PyQt6.QtGui import QAction, QCloseEvent, QColor, QFont, QPainter, QPaintEvent, QPen, QShortcut from PyQt6.QtGui import QAction, QCloseEvent, QFont, QPainter, QPaintEvent, QPen, QShortcut
from PyQt6.QtWidgets import ( from PyQt6.QtWidgets import (
QApplication, QFileDialog, QFormLayout, QHBoxLayout, QLabel, QLineEdit, QApplication, QFileDialog, QFormLayout, QHBoxLayout, QLabel, QLineEdit,
QListView, QMenu, QPushButton, QScrollArea, QStackedWidget, QListView, QMenu, QPushButton, QScrollArea, QStackedWidget,
@@ -77,7 +77,6 @@ class GuiWelcome(NDialog):
self.bgImage = SHARED.theme.getDecoration("welcome") self.bgImage = SHARED.theme.getDecoration("welcome")
self.nwImage = SHARED.theme.getDecoration("nw-text", h=36) self.nwImage = SHARED.theme.getDecoration("nw-text", h=36)
self.bgColor = QColor(54, 54, 54) if SHARED.theme.isDarkTheme else QColor(255, 255, 255)
self.nwLogo = QLabel(self) self.nwLogo = QLabel(self)
self.nwLogo.setPixmap(SHARED.theme.getPixmap("novelwriter", (128, 128))) self.nwLogo.setPixmap(SHARED.theme.getPixmap("novelwriter", (128, 128)))
@@ -178,8 +177,8 @@ class GuiWelcome(NDialog):
hPix = min(hWin, 600) hPix = min(hWin, 600)
tMode = Qt.TransformationMode.SmoothTransformation tMode = Qt.TransformationMode.SmoothTransformation
painter = QPainter(self) painter = QPainter(self)
painter.fillRect(self.rect(), self.bgColor)
painter.drawPixmap(0, hWin - hPix, self.bgImage.scaledToHeight(hPix, tMode)) painter.drawPixmap(0, hWin - hPix, self.bgImage.scaledToHeight(hPix, tMode))
painter.end()
super().paintEvent(event) super().paintEvent(event)
return return