From 7097af5e43bc9f9a3262c39943173a152b1a9722 Mon Sep 17 00:00:00 2001 From: wjyrich Date: Thu, 30 Jul 2026 15:40:57 +0800 Subject: [PATCH] refactor: move ShellSurfaceItemProxy to dock plugin level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ShellSurfaceItemProxy has been relocated from the tray submodule to the dock plugin level to enable reuse across different dock submodules, including the cardleft plugin. The file is added to dock-plugin QML module and referenced via the org.deepin.ds.dock import. Log: ShellSurfaceItemProxy moved to dock plugin for cross-submodule sharing Influence: 1. Verify tray plugin ShellSurfaceItemProxy still works correctly 2. Test that the import path change doesn't break existing functionality 3. Verify quickpanel components load properly with new imports 4. Test cardleft plugin functionality after enabling it in CMakeLists 5. Verify no QML module resolution errors occur 6. Check SPDX license header updates are correct refactor: 将 ShellSurfaceItemProxy 移至 dock 插件层级 将 ShellSurfaceItemProxy 从 tray 子模块迁移至 dock 插件层级,使其可被 cardleft 等多个子模块复用。文件已添加到 dock-plugin QML 模块,并通过 org.deepin.ds.dock 导入引用。 Log: ShellSurfaceItemProxy 移至 dock 插件以实现跨子模块共享 Influence: 1. 验证 tray 插件的 ShellSurfaceItemProxy 功能正常 2. 测试导入路径变更后现有功能未受影响 3. 验证 quickpanel 组件加载新导入后正常 4. 测试在 CMakeLists 中启用 cardleft 插件后的功能 5. 确保无 QML 模块解析错误 6. 检查 SPDX 许可头部更新是否正确 PMS: TASK-392671 --- panels/dock/CMakeLists.txt | 2 ++ panels/dock/{tray => }/ShellSurfaceItemProxy.qml | 2 +- panels/dock/tray/CMakeLists.txt | 1 - panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml | 2 +- panels/dock/tray/quickpanel/DragItem.qml | 1 + panels/dock/tray/quickpanel/PluginItem.qml | 3 ++- panels/dock/tray/quickpanel/SubPluginPage.qml | 3 ++- 7 files changed, 9 insertions(+), 5 deletions(-) rename panels/dock/{tray => }/ShellSurfaceItemProxy.qml (99%) diff --git a/panels/dock/CMakeLists.txt b/panels/dock/CMakeLists.txt index 16d6aa5e0..7c084ec29 100644 --- a/panels/dock/CMakeLists.txt +++ b/panels/dock/CMakeLists.txt @@ -97,6 +97,7 @@ ds_install_package(PACKAGE org.deepin.ds.dock TARGET dockpanel) ds_handle_package_translation(PACKAGE org.deepin.ds.dock) # sub plugins +#add_subdirectory(cardleft) add_subdirectory(showdesktop) add_subdirectory(taskmanager) add_subdirectory(tray) @@ -140,6 +141,7 @@ qt_add_qml_module(dock-plugin SHARED SOURCES ${plugin_sources} QML_FILES DockCompositor.qml OverflowContainer.qml MenuHelper.qml DockPalette.qml + ShellSurfaceItemProxy.qml AppletItemButton.qml AppletItemBackground.qml AppletDockItem.qml diff --git a/panels/dock/tray/ShellSurfaceItemProxy.qml b/panels/dock/ShellSurfaceItemProxy.qml similarity index 99% rename from panels/dock/tray/ShellSurfaceItemProxy.qml rename to panels/dock/ShellSurfaceItemProxy.qml index 4cd8201e0..e55eaea63 100644 --- a/panels/dock/tray/ShellSurfaceItemProxy.qml +++ b/panels/dock/ShellSurfaceItemProxy.qml @@ -18,7 +18,7 @@ Item { property bool pressed: tapHandler.pressed property int cursorShape: Qt.ArrowCursor property alias shellSurfaceItem: impl - + implicitWidth: shellSurface ? shellSurface.width : 16 implicitHeight: shellSurface ? shellSurface.height : 16 diff --git a/panels/dock/tray/CMakeLists.txt b/panels/dock/tray/CMakeLists.txt index 2104d810e..cc63f41f1 100644 --- a/panels/dock/tray/CMakeLists.txt +++ b/panels/dock/tray/CMakeLists.txt @@ -26,7 +26,6 @@ qt_add_qml_module(dock-tray SurfacePopup.qml SurfaceSubPopup.qml TrayItemSurfacePopup.qml - ShellSurfaceItemProxy.qml OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/dock/tray/ ) diff --git a/panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml b/panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml index b67f190db..1b0ef555a 100644 --- a/panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml +++ b/panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml @@ -82,7 +82,7 @@ AppletItemButton { parent: surfaceItem.shellSurfaceItem } - DDT.ShellSurfaceItemProxy { + ShellSurfaceItemProxy { id: surfaceItem anchors.fill: parent shellSurface: pluginItem.plugin diff --git a/panels/dock/tray/quickpanel/DragItem.qml b/panels/dock/tray/quickpanel/DragItem.qml index 24e30ad93..8f225df64 100644 --- a/panels/dock/tray/quickpanel/DragItem.qml +++ b/panels/dock/tray/quickpanel/DragItem.qml @@ -8,6 +8,7 @@ import QtQuick.Window import org.deepin.ds 1.0 import org.deepin.dtk 1.0 +import org.deepin.ds.dock 1.0 import org.deepin.ds.dock.tray 1.0 import org.deepin.ds.dock.tray.quickpanel 1.0 diff --git a/panels/dock/tray/quickpanel/PluginItem.qml b/panels/dock/tray/quickpanel/PluginItem.qml index 7277c5130..bdb56879c 100644 --- a/panels/dock/tray/quickpanel/PluginItem.qml +++ b/panels/dock/tray/quickpanel/PluginItem.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -6,6 +6,7 @@ import QtQuick import QtQuick.Controls import org.deepin.dtk 1.0 +import org.deepin.ds.dock 1.0 import org.deepin.ds.dock.tray 1.0 Control { diff --git a/panels/dock/tray/quickpanel/SubPluginPage.qml b/panels/dock/tray/quickpanel/SubPluginPage.qml index c665aedf0..f20ab6390 100644 --- a/panels/dock/tray/quickpanel/SubPluginPage.qml +++ b/panels/dock/tray/quickpanel/SubPluginPage.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,6 +7,7 @@ import QtQuick.Controls import QtQuick.Layouts import org.deepin.dtk 1.0 +import org.deepin.ds.dock 1.0 import org.deepin.ds.dock.tray 1.0 Item {