From 27b70ac35f78166ecb6749e13f378b2e167bc472 Mon Sep 17 00:00:00 2001 From: Azure <983547216@qq.com> Date: Fri, 12 Sep 2025 12:20:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F+=E6=8B=96=E6=8B=BD=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/utils/DraggableResizableWindow.ts | 4 +++- src/core/window/css/window-form.scss | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/core/utils/DraggableResizableWindow.ts b/src/core/utils/DraggableResizableWindow.ts index 0798135..91d4d80 100644 --- a/src/core/utils/DraggableResizableWindow.ts +++ b/src/core/utils/DraggableResizableWindow.ts @@ -236,7 +236,9 @@ export class DraggableResizableWindow { private onMouseDownDrag = (e: MouseEvent) => { e.preventDefault(); - if (e.target !== this.handle) return; + if (!this.handle?.contains(e.target as Node)) return; + const target = e.target as HTMLElement; + if (target.classList.contains('btn')) return; if (this.getResizeDirection(e)) return; this.startX = e.clientX; diff --git a/src/core/window/css/window-form.scss b/src/core/window/css/window-form.scss index 5058af3..f2bd6be 100644 --- a/src/core/window/css/window-form.scss +++ b/src/core/window/css/window-form.scss @@ -1,6 +1,7 @@ /* 窗体容器 */ .window { - width: 400px; + width: 100%; + height: 100%; border: 1px solid #666; box-shadow: 0 0 10px rgba(0,0,0,0.5); background-color: #ffffff; @@ -10,12 +11,21 @@ /* 标题栏 */ .title-bar { - color: white; display: flex; justify-content: space-between; align-items: center; user-select: none; + .title { + display: block; + padding: 0 5px; + flex-grow: 1; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 18px; + } + .window-controls { display: flex; gap: 2px;