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:
		| @@ -43,7 +43,8 @@ async function createMainWindow () { | |||||||
|          spellcheck: false |          spellcheck: false | ||||||
|       }, |       }, | ||||||
|       autoHideMenuBar: true, |       autoHideMenuBar: true, | ||||||
|       titleBarStyle: isLinux ? 'default' :'hidden', |       frame: !isLinux, | ||||||
|  |       titleBarStyle: 'hidden', | ||||||
|       titleBarOverlay: isWindows |       titleBarOverlay: isWindows | ||||||
|          ? { |          ? { | ||||||
|             color: appTheme === 'dark' ? '#3f3f3f' : '#fff', |             color: appTheme === 'dark' ? '#3f3f3f' : '#fff', | ||||||
|   | |||||||
| @@ -1,6 +1,5 @@ | |||||||
| <template> | <template> | ||||||
|    <div |    <div | ||||||
|       v-if="!isLinux" |  | ||||||
|       id="titlebar" |       id="titlebar" | ||||||
|       @dblclick="toggleFullScreen" |       @dblclick="toggleFullScreen" | ||||||
|    > |    > | ||||||
| @@ -21,16 +20,39 @@ | |||||||
|             class="titlebar-element" |             class="titlebar-element" | ||||||
|             @click="openDevTools" |             @click="openDevTools" | ||||||
|          > |          > | ||||||
|             <BaseIcon icon-name="mdiBugPlayOutline" :size="24" /> |             <BaseIcon icon-name="mdiBugPlayOutline" :size="18" /> | ||||||
|          </div> |          </div> | ||||||
|          <div |          <div | ||||||
|             v-if="isDevelopment" |             v-if="isDevelopment" | ||||||
|             class="titlebar-element" |             class="titlebar-element" | ||||||
|             @click="reload" |             @click="reload" | ||||||
|          > |          > | ||||||
|             <BaseIcon icon-name="mdiRefresh" :size="24" /> |             <BaseIcon icon-name="mdiRefresh" :size="18" /> | ||||||
|          </div> |          </div> | ||||||
|          <div v-if="isWindows" :style="'width: 140px;'" /> |          <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> | ||||||
|    </div> |    </div> | ||||||
| </template> | </template> | ||||||
| @@ -74,6 +96,18 @@ const windowTitle = computed(() => { | |||||||
|    return [connectionName, ...breadcrumbs].join(' • '); |    return [connectionName, ...breadcrumbs].join(' • '); | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | const openDevTools = () => { | ||||||
|  |    w.value.webContents.openDevTools(); | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | const reload = () => { | ||||||
|  |    w.value.reload(); | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | const minimize = () => { | ||||||
|  |    w.value.minimize(); | ||||||
|  | }; | ||||||
|  |  | ||||||
| const toggleFullScreen = () => { | const toggleFullScreen = () => { | ||||||
|    if (isMaximized.value) |    if (isMaximized.value) | ||||||
|       w.value.unmaximize(); |       w.value.unmaximize(); | ||||||
| @@ -81,12 +115,8 @@ const toggleFullScreen = () => { | |||||||
|       w.value.maximize(); |       w.value.maximize(); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const openDevTools = () => { | const closeApp = () => { | ||||||
|    w.value.webContents.openDevTools(); |    ipcRenderer.send('close-app'); | ||||||
| }; |  | ||||||
|  |  | ||||||
| const reload = () => { |  | ||||||
|    w.value.reload(); |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const onResize = () => { | const onResize = () => { | ||||||
|   | |||||||
| @@ -29,13 +29,7 @@ $explorebar-width: 14rem; | |||||||
| $footer-height: 1.5rem; | $footer-height: 1.5rem; | ||||||
|  |  | ||||||
| @function get-excluding-size() { | @function get-excluding-size() { | ||||||
|   @if $platform == linux { |   @return $footer-height + $titlebar-height; | ||||||
|     @return $footer-height; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   @else { |  | ||||||
|     @return $footer-height + $titlebar-height; |  | ||||||
|   } |  | ||||||
| } | } | ||||||
|  |  | ||||||
| /* stylelint-disable-next-line function-no-unknown */ | /* stylelint-disable-next-line function-no-unknown */ | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ | |||||||
|  |  | ||||||
| body { | body { | ||||||
|   user-select: none; |   user-select: none; | ||||||
|  |   background-color: #000; | ||||||
| } | } | ||||||
|  |  | ||||||
| a { | a { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user