From 07da6c6ba586c88eac50fb99b5dbd22d3e2c9991 Mon Sep 17 00:00:00 2001 From: zhangkun2 Date: Mon, 14 Sep 2026 12:11:01 +0800 Subject: [PATCH] fix(dock): deduct column spacing from center space in non-fashion mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In non-fashion mode, dockRawCenterSpace did not account for GridLayout column spacing, causing the center app icon area to extend ~10-20px into the tray area when many apps are open, producing slight overlap. Deduct columnSpacing (1x when dockLeftPart is hidden, 2x when visible) from the maximum center width calculation. Also add clip: true to OverflowContainer's ListView as a visual safety net. PMS: BUG-368011 Log: Influence: 非时尚模式下应用图标与托盘图标区域不再轻微重叠 --- panels/dock/OverflowContainer.qml | 1 + panels/dock/package/main.qml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/panels/dock/OverflowContainer.qml b/panels/dock/OverflowContainer.qml index aa3066df6..9b9558a6e 100644 --- a/panels/dock/OverflowContainer.qml +++ b/panels/dock/OverflowContainer.qml @@ -22,6 +22,7 @@ Item { ListView { id: listView anchors.fill: parent + clip: true orientation: useColumnLayout ? ListView.Vertical : ListView.Horizontal layoutDirection: Qt.LeftToRight verticalLayoutDirection: ListView.TopToBottom diff --git a/panels/dock/package/main.qml b/panels/dock/package/main.qml index 545a71815..bc2dbc179 100644 --- a/panels/dock/package/main.qml +++ b/panels/dock/package/main.qml @@ -58,6 +58,13 @@ Window { // 时尚模式下,dockRightPart 在 gridLayout 右侧,之间需要扣除 dockSpacing // 同时保留左右悬浮间距,避免窗口铺满屏幕后圆角边框被屏幕边缘裁剪。 space -= Math.ceil(gridLayout.columnSpacing) * 2 + fashionDock.floatingMargin * 2; + } else if (gridLayout) { + // 非时尚模式下扣除 GridLayout 列间距,避免中间区域与右侧托盘区域重叠 + let spacing = Math.ceil(gridLayout.columnSpacing); + space -= spacing; + if (dockLeftPart.visible) { + space -= spacing; + } } return Math.max(0, space); }