Skip to content

Commit

Permalink
Revert "[Desktop] Native window virtual menu bar (#2215)"
Browse files Browse the repository at this point in the history
This reverts commit e076783.
  • Loading branch information
webfiltered committed Jan 11, 2025
1 parent 4559605 commit 104c0a5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 38 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
},
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.7",
"@comfyorg/comfyui-electron-types": "^0.4.6",
"@comfyorg/litegraph": "^0.8.60",
"@primevue/themes": "^4.0.5",
"@tiptap/core": "^2.10.4",
Expand Down
8 changes: 0 additions & 8 deletions src/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -764,11 +764,3 @@ audio.comfy-audio.empty-audio-widget {
.p-tree-node-content {
padding: var(--comfy-tree-explorer-item-padding) !important;
}

.app-drag {
app-region: drag;
}

.no-drag {
app-region: no-drag;
}
30 changes: 5 additions & 25 deletions src/views/templates/BaseViewTemplate.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
<template>
<div
class="font-sans w-screen h-screen flex flex-col pointer-events-auto"
class="font-sans w-screen h-screen flex items-center justify-center pointer-events-auto overflow-auto"
:class="[
props.dark
? 'text-neutral-300 bg-neutral-900 dark-theme'
: 'text-neutral-900 bg-neutral-300'
]"
>
<!-- Virtual top menu for native window (drag handle) -->
<div
v-show="isNativeWindow"
ref="topMenuRef"
class="app-drag w-full h-[var(--comfy-topbar-height)]"
/>
<div
class="flex-grow w-full flex items-center justify-center overflow-auto"
>
<slot></slot>
</div>
<slot></slot>
</div>
</template>

<script setup lang="ts">
import { nextTick, onMounted, ref } from 'vue'
import { onMounted } from 'vue'
import { electronAPI, isElectron } from '@/utils/envUtil'
Expand All @@ -45,19 +35,9 @@ const lightTheme = {
symbolColor: '#171717'
}
const topMenuRef = ref<HTMLDivElement | null>(null)
const isNativeWindow = ref(false)
onMounted(async () => {
onMounted(() => {
if (isElectron()) {
const windowStyle = await electronAPI().Config.getWindowStyle()
isNativeWindow.value = windowStyle === 'custom'
await nextTick()
electronAPI().changeTheme({
...(props.dark ? darkTheme : lightTheme),
height: topMenuRef.value.getBoundingClientRect().height
})
electronAPI().changeTheme(props.dark ? darkTheme : lightTheme)
}
})
</script>

0 comments on commit 104c0a5

Please sign in to comment.