保存一下
This commit is contained in:
@@ -88,6 +88,7 @@ export class DesktopProcess extends ProcessImpl {
|
||||
dom.style.zIndex = '0';
|
||||
dom.style.width = `${this._width}px`
|
||||
dom.style.height = `${this._height}px`
|
||||
dom.style.position = 'relative'
|
||||
this._desktopRootDom = dom
|
||||
|
||||
const app = createApp(DesktopComponent, { process: this })
|
||||
|
||||
@@ -5,10 +5,13 @@
|
||||
>
|
||||
<div class="desktop-root" @contextmenu="onContextMenu">
|
||||
<div class="desktop-bg">
|
||||
<div class="desktop-container"
|
||||
<div class="desktop-icons-container"
|
||||
:style="gridStyle">
|
||||
<AppIcon v-for="(appIcon, i) in appIconsRef" :key="i"
|
||||
:iconInfo="appIcon" :gridTemplate="gridTemplate" />
|
||||
:iconInfo="appIcon" :gridTemplate="gridTemplate"
|
||||
@dblclick="runApp(appIcon)"
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-bar"></div>
|
||||
@@ -25,10 +28,11 @@ import { DesktopEventEnum } from '@/core/events/EventTypes.ts'
|
||||
import { useDesktopInit } from '@/core/desktop/ui/hooks/useDesktopInit.ts'
|
||||
import AppIcon from '@/core/desktop/ui/components/AppIcon.vue'
|
||||
import { watch } from 'vue'
|
||||
import type { IDesktopAppIcon } from '@/core/desktop/types/IDesktopAppIcon.ts'
|
||||
|
||||
const props = defineProps<{ process: DesktopProcess }>()
|
||||
|
||||
const { appIconsRef, gridStyle, gridTemplate } = useDesktopInit('.desktop-container')
|
||||
const { appIconsRef, gridStyle, gridTemplate } = useDesktopInit('.desktop-icons-container')
|
||||
|
||||
XSystem.instance.eventManage.addEventListener(
|
||||
DesktopEventEnum.onDesktopRootDomResize,
|
||||
@@ -45,6 +49,10 @@ XSystem.instance.eventManage.addEventListener(
|
||||
const onContextMenu = (e: MouseEvent) => {
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
const runApp = (appIcon: IDesktopAppIcon) => {
|
||||
XSystem.instance.run(appIcon.name)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -60,7 +68,7 @@ $taskBarHeight: 40px;
|
||||
height: calc(100% - #{$taskBarHeight});
|
||||
}
|
||||
|
||||
.desktop-container {
|
||||
.desktop-icons-container {
|
||||
@apply w-full h-full flex-1 grid grid-auto-flow-col pos-relative;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user