mirror of https://github.com/Fabio286/antares.git
perf(Linux): title bar improvements
This commit is contained in:
parent
5fa8bf38e4
commit
85cec05f70
|
@ -6,7 +6,8 @@
|
||||||
"PostgreSQL",
|
"PostgreSQL",
|
||||||
"SQLite",
|
"SQLite",
|
||||||
"Windows",
|
"Windows",
|
||||||
"translation"
|
"translation",
|
||||||
|
"Linux"
|
||||||
],
|
],
|
||||||
"svg.preview.background": "transparent"
|
"svg.preview.background": "transparent"
|
||||||
}
|
}
|
|
@ -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,6 +91,11 @@ else {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
ipcMain.on('change-window-title', (event, title: string) => {
|
||||||
|
mainWindow.setTitle(title)
|
||||||
|
});
|
||||||
|
|
||||||
// quit application when all windows are closed
|
// quit application when all windows are closed
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
// on macOS it is common for applications to stay open until the user explicitly quits
|
// on macOS it is common for applications to stay open until the user explicitly quits
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="titlebar" @dblclick="toggleFullScreen">
|
<div id="titlebar" v-if="!isLinux" @dblclick="toggleFullScreen">
|
||||||
<div class="titlebar-resizer" />
|
<div class="titlebar-resizer" />
|
||||||
<div class="titlebar-elements">
|
<div class="titlebar-elements">
|
||||||
<img
|
<img
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<i class="mdi mdi-24px mdi-refresh" />
|
<i class="mdi mdi-24px mdi-refresh" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isWindows" style="width: 140px;" />
|
<div v-if="isWindows" style="width: 140px;" />
|
||||||
<div
|
<!-- <div
|
||||||
v-if="isLinux"
|
v-if="isLinux"
|
||||||
class="titlebar-element"
|
class="titlebar-element"
|
||||||
@click="minimizeApp"
|
@click="minimizeApp"
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
@click="closeApp"
|
@click="closeApp"
|
||||||
>
|
>
|
||||||
<i class="mdi mdi-24px mdi-close" />
|
<i class="mdi mdi-24px mdi-close" />
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -27,4 +27,14 @@ $titlebar-height: 1.5rem;
|
||||||
$settingbar-width: 3rem;
|
$settingbar-width: 3rem;
|
||||||
$explorebar-width: 14rem;
|
$explorebar-width: 14rem;
|
||||||
$footer-height: 1.5rem;
|
$footer-height: 1.5rem;
|
||||||
$excluding-size: $footer-height + $titlebar-height;
|
|
||||||
|
@function get-excluding-size(){
|
||||||
|
@if $platform == linux{
|
||||||
|
@return $footer-height;
|
||||||
|
}
|
||||||
|
@else {
|
||||||
|
@return $footer-height + $titlebar-height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$excluding-size: get-excluding-size();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
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';
|
||||||
|
@ -342,6 +343,17 @@ 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 => {
|
||||||
|
|
|
@ -104,7 +104,9 @@ const config = {
|
||||||
{
|
{
|
||||||
loader: 'sass-loader',
|
loader: 'sass-loader',
|
||||||
options: {
|
options: {
|
||||||
additionalData: '@import "@/scss/_variables.scss";',
|
additionalData: `
|
||||||
|
$platform: ${process.platform};
|
||||||
|
@import "@/scss/_variables.scss";`,
|
||||||
sassOptions: { quietDeps: true }
|
sassOptions: { quietDeps: true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue