mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-27 02:33:48 +02:00
Add custom macOS-style title bar (#1404)
Introduces a custom MacOSTitleBar component for macOS, updates the Electron window to use 'hiddenInset' titleBarStyle, and adjusts App.vue to conditionally render the new title bar and add appropriate padding. This improves the native look and feel on macOS platforms.
This commit is contained in:
15
src/App.vue
15
src/App.vue
@@ -1,9 +1,13 @@
|
||||
<template>
|
||||
<!DOCTYPE html>
|
||||
<el-config-provider :locale="currentLocale">
|
||||
<!-- macOS Custom Title Bar -->
|
||||
<MacOSTitleBar></MacOSTitleBar>
|
||||
|
||||
<div
|
||||
id="x-app"
|
||||
class="x-app"
|
||||
:class="{ 'with-macos-titlebar': isMacOS }"
|
||||
ondragenter="event.preventDefault()"
|
||||
ondragover="event.preventDefault()"
|
||||
ondrop="event.preventDefault()">
|
||||
@@ -106,6 +110,7 @@
|
||||
|
||||
import Login from './views/Login/Login.vue';
|
||||
import NavMenu from './components/NavMenu.vue';
|
||||
import MacOSTitleBar from './components/TitleBar/MacOSTitleBar.vue';
|
||||
import Sidebar from './views/Sidebar/Sidebar.vue';
|
||||
import Feed from './views/Feed/Feed.vue';
|
||||
import GameLog from './views/GameLog/GameLog.vue';
|
||||
@@ -148,6 +153,11 @@
|
||||
|
||||
console.log(`isLinux: ${LINUX}`);
|
||||
|
||||
// Simple macOS detection
|
||||
const isMacOS = computed(() => {
|
||||
return navigator.platform.indexOf('Mac') > -1;
|
||||
});
|
||||
|
||||
const { locale } = useI18n();
|
||||
|
||||
initNoty();
|
||||
@@ -200,4 +210,9 @@
|
||||
:deep(.el-splitter-bar__dragger) {
|
||||
width: 4px !important;
|
||||
}
|
||||
|
||||
/* Add title bar spacing for macOS */
|
||||
.x-app.with-macos-titlebar {
|
||||
padding-top: 28px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user