From bb3c17d6d5f735368617a76e2fb33c4e12c03766 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sun, 30 Jan 2022 10:00:02 +0100 Subject: [PATCH] current database in app title --- app/src/electron.js | 3 +++ packages/web/src/App.svelte | 2 ++ .../web/src/utility/AppTitleProvider.svelte | 17 +++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 packages/web/src/utility/AppTitleProvider.svelte diff --git a/app/src/electron.js b/app/src/electron.js index 49d12f16..3e80ef66 100644 --- a/app/src/electron.js +++ b/app/src/electron.js @@ -164,6 +164,9 @@ ipcMain.on('update-commands', async (event, arg) => { ipcMain.on('close-window', async (event, arg) => { mainWindow.close(); }); +ipcMain.on('set-title', async (event, arg) => { + mainWindow.setTitle(arg); +}); ipcMain.handle('showOpenDialog', async (event, options) => { const res = electron.dialog.showOpenDialogSync(mainWindow, options); diff --git a/packages/web/src/App.svelte b/packages/web/src/App.svelte index a0527321..7642fb58 100644 --- a/packages/web/src/App.svelte +++ b/packages/web/src/App.svelte @@ -16,6 +16,7 @@ import { subscribePermissionCompiler } from './utility/hasPermission'; import { apiCall } from './utility/api'; import { getUsedApps } from './utility/metadataLoaders'; +import AppTitleProvider from './utility/AppTitleProvider.svelte'; let loadedApi = false; @@ -70,6 +71,7 @@ + {#if $loadingPluginStore?.loaded} diff --git a/packages/web/src/utility/AppTitleProvider.svelte b/packages/web/src/utility/AppTitleProvider.svelte new file mode 100644 index 00000000..9dfeb85a --- /dev/null +++ b/packages/web/src/utility/AppTitleProvider.svelte @@ -0,0 +1,17 @@ + + + + {title} +