diff --git a/frontend/src/App.vue b/frontend/src/App.vue index d97316e..80c8d84 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,18 +1,18 @@ diff --git a/frontend/src/components/builtin/FileList.vue b/frontend/src/components/builtin/FileList.vue index 4856712..d6fd186 100644 --- a/frontend/src/components/builtin/FileList.vue +++ b/frontend/src/components/builtin/FileList.vue @@ -32,7 +32,7 @@ @touchstart.passive="doubleTouch($event, item)" @contextmenu.stop.prevent="handleRightClick($event, item, index)" @drop="hadnleDrop($event, item.path)" @dragenter.prevent="handleDragEnter(index)" @dragover.prevent @dragleave="handleDragLeave()" - @dragstart.stop="startDragApp($event, item)" @click="handleClick(index)" @mousedown.stop :ref="(ref: any) => { + @dragstart.stop="startDragApp($event, item)" @click="handleClick(index, item)" @mousedown.stop :ref="(ref: any) => { if (ref) { appPositions[index] = markRaw(ref as Element); } @@ -130,6 +130,7 @@ function getName(item: any) { return name; } } + function handleOnOpen(item: OsFileWithoutContent) { // props.onOpen(item); // emitEvent('desktop.app.open'); @@ -199,10 +200,16 @@ const hoverIndex = ref(-1); const appPositions = ref>([]); const chosenIndexs = ref>([]); -function handleClick(index: number) { +import { isMobileDevice } from "@/util/device"; +const isMobile = ref(false); +function handleClick(index: number, item: OsFileWithoutContent) { chosenIndexs.value = [index]; + if (isMobile.value) { + handleOnOpen(item) + } } onMounted(() => { + isMobile.value = isMobileDevice(); chosenIndexs.value = []; props.onChosen( throttle((rect: Rect) => { @@ -651,4 +658,35 @@ function handleDragLeave() { background-color: unset; user-select: none; } + +@media screen and (max-width: 768px) { + .file-item { + height: vh(70); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + overflow: hidden; + + &:hover { + background-color: transparent; + } + + .icon { + width: vw(40); + height: vh(40); + } + + .title { + font-size: vw(12); + text-align: center; + } + } + + .chosen { + background-color: transparent; + border: 1px solid transparent; + } + +} diff --git a/frontend/src/components/desktop/DeskItem.vue b/frontend/src/components/desktop/DeskItem.vue index cc09e00..098574a 100644 --- a/frontend/src/components/desktop/DeskItem.vue +++ b/frontend/src/components/desktop/DeskItem.vue @@ -1,10 +1,15 @@ + + \ No newline at end of file diff --git a/frontend/src/components/window/WindowNode.vue b/frontend/src/components/window/WindowNode.vue index feda054..086b7dd 100644 --- a/frontend/src/components/window/WindowNode.vue +++ b/frontend/src/components/window/WindowNode.vue @@ -1,14 +1,13 @@