1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat(Linux): update title bar for better Linux experience

This commit is contained in:
2025-01-30 18:01:56 +01:00
parent 70aae2f194
commit 8e54f7b801
4 changed files with 43 additions and 17 deletions

View File

@@ -43,7 +43,8 @@ async function createMainWindow () {
spellcheck: false
},
autoHideMenuBar: true,
titleBarStyle: isLinux ? 'default' :'hidden',
frame: !isLinux,
titleBarStyle: 'hidden',
titleBarOverlay: isWindows
? {
color: appTheme === 'dark' ? '#3f3f3f' : '#fff',

View File

@@ -1,6 +1,5 @@
<template>
<div
v-if="!isLinux"
id="titlebar"
@dblclick="toggleFullScreen"
>
@@ -21,16 +20,39 @@
class="titlebar-element"
@click="openDevTools"
>
<BaseIcon icon-name="mdiBugPlayOutline" :size="24" />
<BaseIcon icon-name="mdiBugPlayOutline" :size="18" />
</div>
<div
v-if="isDevelopment"
class="titlebar-element"
@click="reload"
>
<BaseIcon icon-name="mdiRefresh" :size="24" />
<BaseIcon icon-name="mdiRefresh" :size="18" />
</div>
<div v-if="isWindows" :style="'width: 140px;'" />
<div v-if="isLinux" class="d-flex">
<div
v-if="isDevelopment"
class="titlebar-element"
@click="minimize"
>
<BaseIcon icon-name="mdiWindowMinimize" :size="18" />
</div>
<div
v-if="isDevelopment"
class="titlebar-element"
@click="toggleFullScreen"
>
<BaseIcon :icon-name="isMaximized ? 'mdiWindowRestore' : 'mdiWindowMaximize'" :size="18" />
</div>
<div
v-if="isDevelopment"
class="titlebar-element"
@click="closeApp"
>
<BaseIcon icon-name="mdiClose" :size="18" />
</div>
</div>
</div>
</div>
</template>
@@ -74,6 +96,18 @@ const windowTitle = computed(() => {
return [connectionName, ...breadcrumbs].join(' • ');
});
const openDevTools = () => {
w.value.webContents.openDevTools();
};
const reload = () => {
w.value.reload();
};
const minimize = () => {
w.value.minimize();
};
const toggleFullScreen = () => {
if (isMaximized.value)
w.value.unmaximize();
@@ -81,12 +115,8 @@ const toggleFullScreen = () => {
w.value.maximize();
};
const openDevTools = () => {
w.value.webContents.openDevTools();
};
const reload = () => {
w.value.reload();
const closeApp = () => {
ipcRenderer.send('close-app');
};
const onResize = () => {

View File

@@ -29,13 +29,7 @@ $explorebar-width: 14rem;
$footer-height: 1.5rem;
@function get-excluding-size() {
@if $platform == linux {
@return $footer-height;
}
@else {
@return $footer-height + $titlebar-height;
}
@return $footer-height + $titlebar-height;
}
/* stylelint-disable-next-line function-no-unknown */

View File

@@ -20,6 +20,7 @@
body {
user-select: none;
background-color: #000;
}
a {