mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-22 22:47:44 +01:00
feat: dynamic app window title
This commit is contained in:
parent
85cec05f70
commit
00242697a1
@ -14,7 +14,7 @@ const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
const isMacOS = process.platform === 'darwin';
|
||||
const isLinux = process.platform === 'linux';
|
||||
const isWindows = process.platform === 'win32';
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
|
||||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true';
|
||||
|
||||
@ -91,9 +91,8 @@ else {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
ipcMain.on('change-window-title', (event, title: string) => {
|
||||
mainWindow.setTitle(title)
|
||||
mainWindow.setTitle(title);
|
||||
});
|
||||
|
||||
// quit application when all windows are closed
|
||||
|
@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<div id="titlebar" v-if="!isLinux" @dblclick="toggleFullScreen">
|
||||
<div
|
||||
v-if="!isLinux"
|
||||
id="titlebar"
|
||||
@dblclick="toggleFullScreen"
|
||||
>
|
||||
<div class="titlebar-resizer" />
|
||||
<div class="titlebar-elements">
|
||||
<img
|
||||
@ -98,6 +102,11 @@ export default {
|
||||
return [connectionName, ...breadcrumbs].join(' • ');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
windowTitle: function (val) {
|
||||
ipcRenderer.send('change-window-title', val);
|
||||
}
|
||||
},
|
||||
created () {
|
||||
window.addEventListener('resize', this.onResize);
|
||||
},
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { defineStore, acceptHMRUpdate } from 'pinia';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import Store from 'electron-store';
|
||||
import Connection from '@/ipc-api/Connection';
|
||||
import Schema from '@/ipc-api/Schema';
|
||||
@ -343,17 +342,6 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
||||
breadcrumbs: { ...breadcrumbsObj, ...payload }
|
||||
}
|
||||
: workspace);
|
||||
|
||||
|
||||
const workspace = this.getWorkspace(this.selectedWorkspace);
|
||||
if(workspace){
|
||||
const { getConnectionName } = useConnectionsStore();
|
||||
const connectionName = getConnectionName(this.selectedWorkspace);
|
||||
const breadcrumbs = Object.values(workspace.value.breadcrumbs).filter(breadcrumb => breadcrumb) || [workspace.value.client];
|
||||
const windowTitle = [connectionName, ...breadcrumbs].join(' • ');
|
||||
ipcRenderer.send('change-window-title', windowTitle);
|
||||
}
|
||||
|
||||
},
|
||||
addLoadedSchema (schema) {
|
||||
this.workspaces = this.workspaces.map(workspace => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user