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