Use a transparent image for the welcome dialog
This commit is contained in:
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 |
@@ -634,7 +634,7 @@ class GuiIcons:
|
||||
"unfold": ("unfold-show", "unfold-hide"),
|
||||
}
|
||||
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"),
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ from PyQt6.QtCore import (
|
||||
QAbstractListModel, QModelIndex, QObject, QPoint, QSize, Qt, pyqtSignal,
|
||||
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 (
|
||||
QApplication, QFileDialog, QFormLayout, QHBoxLayout, QLabel, QLineEdit,
|
||||
QListView, QMenu, QPushButton, QScrollArea, QStackedWidget,
|
||||
@@ -77,7 +77,6 @@ class GuiWelcome(NDialog):
|
||||
|
||||
self.bgImage = SHARED.theme.getDecoration("welcome")
|
||||
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.setPixmap(SHARED.theme.getPixmap("novelwriter", (128, 128)))
|
||||
@@ -178,8 +177,8 @@ class GuiWelcome(NDialog):
|
||||
hPix = min(hWin, 600)
|
||||
tMode = Qt.TransformationMode.SmoothTransformation
|
||||
painter = QPainter(self)
|
||||
painter.fillRect(self.rect(), self.bgColor)
|
||||
painter.drawPixmap(0, hWin - hPix, self.bgImage.scaledToHeight(hPix, tMode))
|
||||
painter.end()
|
||||
super().paintEvent(event)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user