From 83d2cb4f827d219654afef89cf7582a0afee1185 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:19:21 +0200 Subject: [PATCH] Swap project name and app name in window title (#1910) --- novelwriter/guimain.py | 5 +---- tests/test_dialogs/test_dlg_projectsettings.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py index 14b124fa2..cb818aba9 100644 --- a/novelwriter/guimain.py +++ b/novelwriter/guimain.py @@ -1361,10 +1361,7 @@ def _connectMenuActions(self) -> None: def _updateWindowTitle(self, projName: str | None = None) -> None: """Set the window title and add the project's name.""" - winTitle = CONFIG.appName - if projName is not None: - winTitle += " - %s" % projName - self.setWindowTitle(winTitle) + self.setWindowTitle(" - ".join(filter(None, [projName, CONFIG.appName]))) return def _getTagSource(self, tag: str) -> tuple[str | None, str | None]: diff --git a/tests/test_dialogs/test_dlg_projectsettings.py b/tests/test_dialogs/test_dlg_projectsettings.py index 210012731..36fba384e 100644 --- a/tests/test_dialogs/test_dlg_projectsettings.py +++ b/tests/test_dialogs/test_dlg_projectsettings.py @@ -129,7 +129,7 @@ def testDlgProjSettings_SettingsPage(qtbot, monkeypatch, nwGUI, fncPath, projPat assert project.data.doBackup is False nwGUI._processProjectSettingsChanges(False) - assert nwGUI.windowTitle() == "novelWriter - Project Name" + assert nwGUI.windowTitle() == "Project Name - novelWriter" # qtbot.stop()