Update title on welcome dialog

This commit is contained in:
Veronica Berglyd Olsen committed 2023-12-19 17:29:33 +01:00
1 parent 818fa2bf11
commit 8a61d57ce4
6 files changed
+78 -20

No files matched your search

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="460" height="60" version="1.1" viewBox="0 0 121.71 15.875" xmlns="http://www.w3.org/2000/svg">
<path d="m50.202 0v1.7585h0.67954c0.31249 0 0.53129 0.070663 0.65629 0.21136 0.14062 0.12506 0.21084 0.33602 0.21084 0.63304v10.294c0 0.31265-0.07022 0.53937-0.21084 0.68006-0.125 0.14069-0.3438 0.21084-0.65629 0.21084h-0.67954v1.7353h5.6012v-1.7353h-0.67954c-0.29687 0-0.51567-0.07015-0.65629-0.21084-0.14062-0.14069-0.21084-0.35927-0.21084-0.65629v-12.921zm36.093 0.32815v2.1575h2.6484v-2.1575zm-29.179 0.023771v1.7353h0.49248c0.45312 0 0.77317 0.070146 0.96066 0.21084 0.1875 0.12506 0.3203 0.37516 0.39842 0.75034l2.8122 12.475h2.0624l2.6954-8.6289 2.742 8.6289h2.0392l2.789-12.475c0.07812-0.37518 0.21093-0.62528 0.39843-0.75034 0.1875-0.14069 0.50807-0.21084 0.96118-0.21084h0.51573v-1.7353h-3.5863l-2.3203 10.88-2.5544-8.324h-1.9689l-2.5311 8.324-2.2965-10.88zm38.109 0.58601-2.4846 0.79737v2.5327h-1.8278v1.6883h1.8278v6.1433c0 1.235 0.3282 2.1734 0.98444 2.8143 0.65624 0.64094 1.6327 0.96118 2.9295 0.96118 0.82811 0 1.5471-0.11743 2.1565-0.35192 0.60936-0.23449 1.1716-0.57049 1.6872-1.0082v-1.7818h-2.1327v1.0082c-0.35937 0.29702-0.88296 0.44545-1.5704 0.44545-0.53124 0-0.92966-0.14843-1.1953-0.44545-0.24999-0.29702-0.37465-0.78959-0.37465-1.4774v-6.3076h3.3745v-1.6883h-3.3745zm-87.678 2.9781c-0.96873 0-1.7971 0.15605-2.4846 0.46871-0.67186 0.29702-1.2733 0.78197-1.8045 1.4542l-0.14056-1.571h-2.9998v1.7585h0.49196c0.31249 0 0.53129 0.070146 0.65629 0.21084 0.125 0.12506 0.18759 0.34415 0.18759 0.65681v6.0265c0 0.31265-0.070218 0.53885-0.21084 0.67955-0.125 0.12506-0.3438 0.18758-0.65629 0.18758h-0.58601v1.7353h5.3671v-1.7353h-0.60927c-0.29687 0-0.50804-0.06252-0.63304-0.18758-0.10937-0.14069-0.16381-0.36689-0.16381-0.67955v-4.7372c0-0.8129 0.25747-1.4458 0.77308-1.8991s1.172-0.68006 1.9689-0.68006c0.73436 0 1.2656 0.17995 1.5937 0.5395 0.32812 0.34392 0.49248 0.90664 0.49248 1.6883v7.691h4.0308v-1.7353h-0.65629c-0.31249 0-0.53892-0.06252-0.67954-0.18758-0.125-0.14069-0.18758-0.36689-0.18758-0.67955v-5.1123c0-2.595-1.2497-3.8923-3.7496-3.8923zm12.351 0c-1.9218 0-3.3669 0.53171-4.3357 1.5947-0.9531 1.0474-1.4299 2.5164-1.4299 4.408 0 1.8759 0.48441 3.3379 1.4531 4.3853s2.4062 1.571 4.3124 1.571c1.9062 0 3.3437-0.52357 4.3124-1.571 0.96873-1.0474 1.4531-2.5093 1.4531-4.3853 0-1.8916-0.48441-3.3606-1.4531-4.408-0.9531-1.063-2.3906-1.5947-4.3124-1.5947zm23.39 0c-1.8281 0-3.2421 0.51595-4.2421 1.5477-0.98435 1.0161-1.4769 2.5401-1.4769 4.5723 0 1.9072 0.53123 3.361 1.5937 4.3615 1.0781 0.98486 2.5079 1.4774 4.2891 1.4774 1.0312 0 1.9217-0.11743 2.6717-0.35192 0.76561-0.21886 1.477-0.56248 2.1332-1.0315v-1.6418h-2.1797v0.84439c-0.32812 0.20322-0.6955 0.35165-1.1017 0.44545-0.40624 0.07816-0.90643 0.11731-1.5002 0.11731-1.0468 0-1.8824-0.29686-2.5073-0.8909-0.60936-0.60967-0.91416-1.5481-0.91416-2.8143h8.6015v-1.0785c0-1.704-0.45338-3.0561-1.3596-4.0566-0.90623-1.0005-2.2419-1.5007-4.0075-1.5007zm63.772 0c-1.8281 0-3.2422 0.51595-4.2421 1.5477-0.98436 1.0161-1.4764 2.5401-1.4764 4.5723 0 1.9072 0.53122 3.361 1.5937 4.3615 1.0781 0.98486 2.5074 1.4774 4.2886 1.4774 1.0312 0 1.9222-0.11743 2.6722-0.35192 0.7656-0.21886 1.4764-0.56248 2.1327-1.0315v-1.6418h-2.1797v0.84439c-0.32811 0.20322-0.6955 0.35165-1.1017 0.44545-0.40624 0.07816-0.90591 0.11731-1.4996 0.11731-1.0468 0-1.8829-0.29686-2.5079-0.8909-0.60936-0.60967-0.91415-1.5481-0.91415-2.8143h8.6015v-1.0785c0-1.704-0.45338-3.0561-1.3596-4.0566-0.90623-1.0005-2.2419-1.5007-4.0075-1.5007zm-81.607 0.35192v1.618h0.49196c0.39062 0 0.65623 0.046764 0.79685 0.14056 0.15625 0.078163 0.27328 0.24235 0.3514 0.49248l3.2344 9.0041h2.5781l3.2112-9.0041c0.09375-0.25012 0.21078-0.41431 0.3514-0.49248 0.15625-0.093796 0.42186-0.14056 0.79685-0.14056h0.51573v-1.618h-3.2582l-2.9058 8.7933-2.9063-8.7933zm50.694 0v1.7348h0.49196c0.29687 0 0.50804 0.070663 0.63304 0.21136 0.125 0.14069 0.18758 0.35927 0.18758 0.65629v6.0503c0 0.31265-0.07022 0.53885-0.21084 0.67955-0.125 0.12506-0.3438 0.18758-0.65629 0.18758h-0.58601v1.7353h5.3671v-1.7353h-0.58601c-0.29687 0-0.50804-0.06252-0.63304-0.18758-0.125-0.14069-0.18707-0.36689-0.18707-0.67955v-4.4788c0-0.82853 0.18725-1.4385 0.56224-1.8293 0.37499-0.40645 1.008-0.60978 1.8986-0.60978h1.3121v-1.7348h-1.078c-0.67186 0-1.2575 0.093528-1.7575 0.28112-0.48436 0.18759-0.88278 0.52359-1.1953 1.0082l-0.32815-1.2893zm8.6718 0v1.7585h0.67954c0.31249 0 0.53129 0.070146 0.65629 0.21084 0.14062 0.12506 0.21084 0.33602 0.21084 0.63304v6.0265c0 0.31265-0.07022 0.53937-0.21084 0.68006-0.125 0.14069-0.3438 0.21084-0.65629 0.21084h-0.67954v1.7353h5.6012v-1.7353h-0.67954c-0.29687 0-0.51567-0.07015-0.65629-0.21084-0.14062-0.14069-0.21084-0.35927-0.21084-0.65629v-8.6527zm29.296 0v1.7348h0.49247c0.29687 0 0.50753 0.070663 0.63252 0.21136 0.125 0.14069 0.18759 0.35927 0.18759 0.65629v6.0503c0 0.31265-0.0702 0.53885-0.21085 0.67955-0.12499 0.12506-0.34379 0.18758-0.65629 0.18758h-0.58601v1.7353h5.3671v-1.7353h-0.58601c-0.29686 0-0.50751-0.06252-0.63251-0.18758-0.125-0.14069-0.18758-0.36689-0.18758-0.67955v-4.4788c0-0.82853 0.18725-1.4385 0.56223-1.8293 0.37499-0.4064Line truncated
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="460" height="60" version="1.1" viewBox="0 0 121.71 15.875" xmlns="http://www.w3.org/2000/svg">
<path d="m50.202 0v1.7585h0.67954c0.31249 0 0.53129 0.070663 0.65629 0.21136 0.14062 0.12506 0.21084 0.33602 0.21084 0.63304v10.294c0 0.31265-0.07022 0.53937-0.21084 0.68006-0.125 0.14069-0.3438 0.21084-0.65629 0.21084h-0.67954v1.7353h5.6012v-1.7353h-0.67954c-0.29687 0-0.51567-0.07015-0.65629-0.21084-0.14062-0.14069-0.21084-0.35927-0.21084-0.65629v-12.921zm36.093 0.32815v2.1575h2.6484v-2.1575zm-29.179 0.023771v1.7353h0.49248c0.45312 0 0.77317 0.070146 0.96066 0.21084 0.1875 0.12506 0.3203 0.37516 0.39842 0.75034l2.8122 12.475h2.0624l2.6954-8.6289 2.742 8.6289h2.0392l2.789-12.475c0.07812-0.37518 0.21093-0.62528 0.39843-0.75034 0.1875-0.14069 0.50807-0.21084 0.96118-0.21084h0.51573v-1.7353h-3.5863l-2.3203 10.88-2.5544-8.324h-1.9689l-2.5311 8.324-2.2965-10.88zm38.109 0.58601-2.4846 0.79737v2.5327h-1.8278v1.6883h1.8278v6.1433c0 1.235 0.3282 2.1734 0.98444 2.8143 0.65624 0.64094 1.6327 0.96118 2.9295 0.96118 0.82811 0 1.5471-0.11743 2.1565-0.35192 0.60936-0.23449 1.1716-0.57049 1.6872-1.0082v-1.7818h-2.1327v1.0082c-0.35937 0.29702-0.88296 0.44545-1.5704 0.44545-0.53124 0-0.92966-0.14843-1.1953-0.44545-0.24999-0.29702-0.37465-0.78959-0.37465-1.4774v-6.3076h3.3745v-1.6883h-3.3745zm-87.678 2.9781c-0.96873 0-1.7971 0.15605-2.4846 0.46871-0.67186 0.29702-1.2733 0.78197-1.8045 1.4542l-0.14056-1.571h-2.9998v1.7585h0.49196c0.31249 0 0.53129 0.070146 0.65629 0.21084 0.125 0.12506 0.18759 0.34415 0.18759 0.65681v6.0265c0 0.31265-0.070218 0.53885-0.21084 0.67955-0.125 0.12506-0.3438 0.18758-0.65629 0.18758h-0.58601v1.7353h5.3671v-1.7353h-0.60927c-0.29687 0-0.50804-0.06252-0.63304-0.18758-0.10937-0.14069-0.16381-0.36689-0.16381-0.67955v-4.7372c0-0.8129 0.25747-1.4458 0.77308-1.8991s1.172-0.68006 1.9689-0.68006c0.73436 0 1.2656 0.17995 1.5937 0.5395 0.32812 0.34392 0.49248 0.90664 0.49248 1.6883v7.691h4.0308v-1.7353h-0.65629c-0.31249 0-0.53892-0.06252-0.67954-0.18758-0.125-0.14069-0.18758-0.36689-0.18758-0.67955v-5.1123c0-2.595-1.2497-3.8923-3.7496-3.8923zm12.351 0c-1.9218 0-3.3669 0.53171-4.3357 1.5947-0.9531 1.0474-1.4299 2.5164-1.4299 4.408 0 1.8759 0.48441 3.3379 1.4531 4.3853s2.4062 1.571 4.3124 1.571c1.9062 0 3.3437-0.52357 4.3124-1.571 0.96873-1.0474 1.4531-2.5093 1.4531-4.3853 0-1.8916-0.48441-3.3606-1.4531-4.408-0.9531-1.063-2.3906-1.5947-4.3124-1.5947zm23.39 0c-1.8281 0-3.2421 0.51595-4.2421 1.5477-0.98435 1.0161-1.4769 2.5401-1.4769 4.5723 0 1.9072 0.53123 3.361 1.5937 4.3615 1.0781 0.98486 2.5079 1.4774 4.2891 1.4774 1.0312 0 1.9217-0.11743 2.6717-0.35192 0.76561-0.21886 1.477-0.56248 2.1332-1.0315v-1.6418h-2.1797v0.84439c-0.32812 0.20322-0.6955 0.35165-1.1017 0.44545-0.40624 0.07816-0.90643 0.11731-1.5002 0.11731-1.0468 0-1.8824-0.29686-2.5073-0.8909-0.60936-0.60967-0.91416-1.5481-0.91416-2.8143h8.6015v-1.0785c0-1.704-0.45338-3.0561-1.3596-4.0566-0.90623-1.0005-2.2419-1.5007-4.0075-1.5007zm63.772 0c-1.8281 0-3.2422 0.51595-4.2421 1.5477-0.98436 1.0161-1.4764 2.5401-1.4764 4.5723 0 1.9072 0.53122 3.361 1.5937 4.3615 1.0781 0.98486 2.5074 1.4774 4.2886 1.4774 1.0312 0 1.9222-0.11743 2.6722-0.35192 0.7656-0.21886 1.4764-0.56248 2.1327-1.0315v-1.6418h-2.1797v0.84439c-0.32811 0.20322-0.6955 0.35165-1.1017 0.44545-0.40624 0.07816-0.90591 0.11731-1.4996 0.11731-1.0468 0-1.8829-0.29686-2.5079-0.8909-0.60936-0.60967-0.91415-1.5481-0.91415-2.8143h8.6015v-1.0785c0-1.704-0.45338-3.0561-1.3596-4.0566-0.90623-1.0005-2.2419-1.5007-4.0075-1.5007zm-81.607 0.35192v1.618h0.49196c0.39062 0 0.65623 0.046764 0.79685 0.14056 0.15625 0.078163 0.27328 0.24235 0.3514 0.49248l3.2344 9.0041h2.5781l3.2112-9.0041c0.09375-0.25012 0.21078-0.41431 0.3514-0.49248 0.15625-0.093796 0.42186-0.14056 0.79685-0.14056h0.51573v-1.618h-3.2582l-2.9058 8.7933-2.9063-8.7933zm50.694 0v1.7348h0.49196c0.29687 0 0.50804 0.070663 0.63304 0.21136 0.125 0.14069 0.18758 0.35927 0.18758 0.65629v6.0503c0 0.31265-0.07022 0.53885-0.21084 0.67955-0.125 0.12506-0.3438 0.18758-0.65629 0.18758h-0.58601v1.7353h5.3671v-1.7353h-0.58601c-0.29687 0-0.50804-0.06252-0.63304-0.18758-0.125-0.14069-0.18707-0.36689-0.18707-0.67955v-4.4788c0-0.82853 0.18725-1.4385 0.56224-1.8293 0.37499-0.40645 1.008-0.60978 1.8986-0.60978h1.3121v-1.7348h-1.078c-0.67186 0-1.2575 0.093528-1.7575 0.28112-0.48436 0.18759-0.88278 0.52359-1.1953 1.0082l-0.32815-1.2893zm8.6718 0v1.7585h0.67954c0.31249 0 0.53129 0.070146 0.65629 0.21084 0.14062 0.12506 0.21084 0.33602 0.21084 0.63304v6.0265c0 0.31265-0.07022 0.53937-0.21084 0.68006-0.125 0.14069-0.3438 0.21084-0.65629 0.21084h-0.67954v1.7353h5.6012v-1.7353h-0.67954c-0.29687 0-0.51567-0.07015-0.65629-0.21084-0.14062-0.14069-0.21084-0.35927-0.21084-0.65629v-8.6527zm29.296 0v1.7348h0.49247c0.29687 0 0.50753 0.070663 0.63252 0.21136 0.125 0.14069 0.18759 0.35927 0.18759 0.65629v6.0503c0 0.31265-0.0702 0.53885-0.21085 0.67955-0.12499 0.12506-0.34379 0.18758-0.65629 0.18758h-0.58601v1.7353h5.3671v-1.7353h-0.58601c-0.29686 0-0.50751-0.06252-0.63251-0.18758-0.125-0.14069-0.18758-0.36689-0.18758-0.67955v-4.4788c0-0.82853 0.18725-1.4385 0.56223-1.8293 0.37499-0.4064Line truncated
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

+13
View File
@@ -110,6 +110,7 @@ class Config:
# Size Settings
self._mainWinSize = [1200, 650] # Last size of the main GUI window
self._welcomeSize = [800, 500] # Last size of the welcome window
self._prefsWinSize = [700, 615] # Last size of the Preferences dialog
self._projLoadCols = [280, 60, 160] # Last columns widths of the Project Load dialog
self._mainPanePos = [300, 800] # Last position of the main window splitter
@@ -249,6 +250,10 @@ class Config:
def mainWinSize(self) -> list[int]:
return [int(x*self.guiScale) for x in self._mainWinSize]
@property
def welcomeWinSize(self) -> list[int]:
return [int(x*self.guiScale) for x in self._welcomeSize]
@property
def preferencesWinSize(self) -> list[int]:
return [int(x*self.guiScale) for x in self._prefsWinSize]
@@ -306,6 +311,12 @@ class Config:
self._mainWinSize[1] = height
return
def setWelcomeWinSize(self, width: int, height: int) -> None:
"""Set the size of the Preferences dialog window."""
self._welcomeSize[0] = int(width/self.guiScale)
self._welcomeSize[1] = int(height/self.guiScale)
return
def setPreferencesWinSize(self, width: int, height: int) -> None:
"""Set the size of the Preferences dialog window."""
self._prefsWinSize[0] = int(width/self.guiScale)
@@ -545,6 +556,7 @@ class Config:
# Sizes
sec = "Sizes"
self._mainWinSize = conf.rdIntList(sec, "mainwindow", self._mainWinSize)
self._welcomeSize = conf.rdIntList(sec, "welcome", self._welcomeSize)
self._prefsWinSize = conf.rdIntList(sec, "preferences", self._prefsWinSize)
self._projLoadCols = conf.rdIntList(sec, "projloadcols", self._projLoadCols)
self._mainPanePos = conf.rdIntList(sec, "mainpane", self._mainPanePos)
@@ -652,6 +664,7 @@ class Config:
conf["Sizes"] = {
"mainwindow": self._packList(self._mainWinSize),
"welcome": self._packList(self._welcomeSize),
"preferences": self._packList(self._prefsWinSize),
"projloadcols": self._packList(self._projLoadCols),
"mainpane": self._packList(self._mainPanePos),
+1 -1
View File
@@ -42,7 +42,7 @@ logger = logging.getLogger(__name__)
NWEnum = TypeVar("NWEnum", bound=Enum)
VALID_MAP = {
VALID_MAP: dict[str, set[str]] = {
"GuiWritingStats": {
"winWidth", "winHeight", "widthCol0", "widthCol1", "widthCol2",
"widthCol3", "sortCol", "sortOrder", "incNovel", "incNotes",
+12 -7
View File
@@ -67,6 +67,7 @@ class GuiTheme:
self.themeLicense = ""
self.themeLicenseUrl = ""
self.themeIcons = ""
self.isLightTheme = True
# GUI
self.statNone = [120, 120, 120]
@@ -112,7 +113,7 @@ class GuiTheme:
self._setGuiFont()
# Load Themes
self._guiPalette = QPalette()
self._guiPalette = QPalette()
self._themeList: list[tuple[str, str]] = []
self._syntaxList: list[tuple[str, str]] = []
self._availThemes: dict[str, Path] = {}
@@ -256,7 +257,8 @@ class GuiTheme:
textLNess = textCol.lightnessF()
if self.helpText == [0, 0, 0]:
if backLNess > textLNess:
self.isLightTheme = backLNess > textLNess
if self.isLightTheme:
helpLCol = textLNess + 0.35*(backLNess - textLNess)
else:
helpLCol = backLNess + 0.65*(textLNess - backLNess)
@@ -443,7 +445,7 @@ class GuiIcons:
missing, a blank icon is returned and a warning issued.
"""
ICON_KEYS = {
ICON_KEYS: set[str] = {
# Project and GUI Icons
"novelwriter", "alert_error", "alert_info", "alert_question", "alert_warn",
"build_excluded", "build_filtered", "build_included", "proj_chapter", "proj_details",
@@ -478,13 +480,15 @@ class GuiIcons:
"deco_doc_nt_n",
}
TOGGLE_ICON_KEYS = {
TOGGLE_ICON_KEYS: dict[str, tuple[str, str]] = {
"sticky": ("sticky-on", "sticky-off"),
"bullet": ("bullet-on", "bullet-off"),
}
IMAGE_MAP = {
"wiz-back": "wizard-back.jpg",
IMAGE_MAP: dict[str, tuple[str, str]] = {
"wiz-back": ("wizard-back.jpg", "wizard-back.jpg"),
"welcome": ("welcome.jpg", "welcome.jpg"),
"nw-text": ("novelwriter-text-light.svg", "novelwriter-text-dark.svg"),
}
def __init__(self, mainTheme: GuiTheme) -> None:
@@ -598,7 +602,8 @@ class GuiIcons:
if name in self._themeMap:
imgPath = self._themeMap[name]
elif name in self.IMAGE_MAP:
imgPath = CONFIG.assetPath("images") / self.IMAGE_MAP[name]
idx = 0 if self.mainTheme.isLightTheme else 1
imgPath = CONFIG.assetPath("images") / self.IMAGE_MAP[name][idx]
else:
logger.error("Decoration with name '%s' does not exist", name)
return QPixmap()
+44 -12
View File
@@ -28,7 +28,7 @@ import logging
from typing import TYPE_CHECKING
from datetime import datetime
from PyQt5.QtGui import QPaintEvent, QPainter, QPixmap
from PyQt5.QtGui import QCloseEvent, QPaintEvent, QPainter
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (
QDialog, QDialogButtonBox, QHBoxLayout, QLabel, QStackedWidget,
@@ -36,6 +36,7 @@ from PyQt5.QtWidgets import (
)
from novelwriter import CONFIG, SHARED, __version__, __date__
from novelwriter.constants import nwUnicode
if TYPE_CHECKING: # pragma: no cover
from novelwriter.guimain import GuiMain
@@ -50,19 +51,30 @@ class GuiWelcome(QDialog):
logger.debug("Create: GuiWelcome")
self.bgImage = QPixmap(str(CONFIG.assetPath("images") / "welcome.jpg"))
self.setWindowTitle(self.tr("Welcome"))
self.setMinimumWidth(CONFIG.pxInt(700))
self.setMinimumHeight(CONFIG.pxInt(400))
hA = CONFIG.pxInt(8)
hB = CONFIG.pxInt(16)
hC = CONFIG.pxInt(24)
hD = CONFIG.pxInt(36)
hE = CONFIG.pxInt(48)
hF = CONFIG.pxInt(96)
self.resize(*CONFIG.welcomeWinSize)
self.bgImage = SHARED.theme.loadDecoration("welcome")
self.nwImage = SHARED.theme.loadDecoration("nw-text", h=hD)
self.nwLogo = QLabel()
self.nwLogo.setPixmap(SHARED.theme.getPixmap("novelwriter", (96, 96)))
font = self.font()
font.setPointSize(48)
self.nwLogo.setPixmap(SHARED.theme.getPixmap("novelwriter", (hF, hF)))
self.nwLabel = QLabel("novelWriter")
self.nwLabel.setFont(font)
self.nwLabel.setPixmap(self.nwImage)
self.nwInfo = QLabel(self.tr("Version {0}, Released on {1}").format(
__version__, datetime.strptime(__date__, "%Y-%m-%d").strftime("%x")
self.nwInfo = QLabel(self.tr("Version {0} {1} Released on {2}").format(
__version__, nwUnicode.U_ENDASH, datetime.strptime(__date__, "%Y-%m-%d").strftime("%x")
))
self.mainStack = QStackedWidget()
@@ -71,6 +83,8 @@ class GuiWelcome(QDialog):
# Buttons
# =======
self.btnBox = QDialogButtonBox(QDialogButtonBox.Open | QDialogButtonBox.Cancel, self)
self.btnBox.accepted.connect(self.accept)
self.btnBox.rejected.connect(self.close)
self.newButton = self.btnBox.addButton(self.tr("New Project"), QDialogButtonBox.ActionRole)
self.newButton.setIcon(SHARED.theme.getIcon("add"))
@@ -81,9 +95,12 @@ class GuiWelcome(QDialog):
# Assemble
# ========
self.innerBox = QVBoxLayout()
self.innerBox.addSpacing(hB)
self.innerBox.addWidget(self.nwLabel)
self.innerBox.addWidget(self.nwInfo)
self.innerBox.addSpacing(hA)
self.innerBox.addWidget(self.mainStack)
self.innerBox.addSpacing(hA)
self.innerBox.addWidget(self.btnBox)
topRight = Qt.AlignmentFlag.AlignTop | Qt.AlignmentFlag.AlignRight
@@ -91,12 +108,10 @@ class GuiWelcome(QDialog):
self.outerBox = QHBoxLayout()
self.outerBox.addWidget(self.nwLogo, 3, topRight)
self.outerBox.addLayout(self.innerBox, 7)
self.outerBox.setContentsMargins(24, 24, 24, 96)
self.outerBox.setContentsMargins(hF, hE, hC, hE)
self.setLayout(self.outerBox)
self.setMinimumSize(900, 500)
logger.debug("Ready: GuiWelcome")
return
@@ -119,6 +134,23 @@ class GuiWelcome(QDialog):
super().paintEvent(event)
return
def closeEvent(self, event: QCloseEvent) -> None:
"""Capture the user closing the window and save settings."""
self._saveSettings()
event.accept()
self.deleteLater()
return
##
# Internal Functions
##
def _saveSettings(self) -> None:
"""Save the user GUI settings."""
logger.debug("Saving State: GuiWelcome")
CONFIG.setWelcomeWinSize(self.width(), self.height())
return
# END Class GuiWelcome