From 3a0695fe67353aa0337e93453c349bfb2727b735 Mon Sep 17 00:00:00 2001 From: wjyrich Date: Thu, 2 Jul 2026 19:59:14 +0800 Subject: [PATCH 1/2] feat: add FashionAlignment mode for dock panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Implement new FashionAlignment enum value (2) for dock item alignment 2. Create FashionDockController QML component to manage fashion dock layout and appearance 3. Add "Fashion Mode" menu item in dock context menu for easy mode switching 4. Integrate fashion dock logic into main dock window: adjust width, anchors, margins, window radius, and blur effects 5. Update showdesktop and taskmanager to be hidden or behave differently in fashion mode 6. Ensure width animation when entering/exiting fashion mode 7. Add appropriate DTK blur and styling for fashion dock appearance 8. Update string conversion functions to support the new "fashion" alignment 9. Hide left part and adjust spacing in fashion mode for a compact, floating design Log: Added new dock fashion alignment mode with floating UI and compact layout Influence: 1. Test switching between Center, Left, and Fashion alignment modes via context menu 2. Verify fashion mode only enables on Bottom/Top positions and not in column layout 3. Check that showdesktop widget is hidden in fashion mode 4. Verify dock width and margin adjustments in fashion mode (floating margin, vertical padding) 5. Test taskmanager behavior in fashion mode (no remaining space calculation, no text calculator) 6. Verify blur and color blending correctness in fashion mode for both light and dark themes 7. Test width animation when enabling/disabling fashion mode 8. Verify dock exclusion zone includes floating margin in fashion mode 9. Test on different screen sizes and DPI settings 10. Validate that left part and its items are hidden in fashion mode feat: 新增时尚模式对齐方式 1. 实现新的时尚模式对齐枚举值 (2),用于 dock 面板的项目对齐 2. 创建 FashionDockController QML 组件,管理时尚模式布局和外观 3. 在 dock 右键菜单中添加 "时尚模式" 菜单项,便于模式切换 4. 将时尚模式逻辑集成到主 dock 窗口中:调整宽度、锚点、边距、窗口圆角和 模糊效果 5. 更新显示桌面和任务管理器,使其在时尚模式下隐藏或改变行为 6. 在进入/退出时尚模式时启用宽度动画 7. 为时尚模式外观添加合适的 DTK 模糊和样式 8. 更新字符串转换函数以支持新的 "fashion" 对齐方式 9. 在时尚模式下隐藏左侧部分并调整间距,实现紧凑浮动设计 Log: 新增时尚模式对齐方式,浮动UI和紧凑布局 Influence: 1. 通过右键菜单测试中心、左对齐和时尚模式之间的切换 2. 验证时尚模式仅在底部/顶部位置且非列布局时启用 3. 检查显示桌面小部件在时尚模式下是否隐藏 4. 验证时尚模式下的 dock 宽度和边距调整(浮动边距、垂直内边距) 5. 测试任务管理器在时尚模式下的行为(无剩余空间计算、无文本计算器) 6. 验证时尚模式下浅色和深色主题的模糊和颜色混合正确性 7. 测试启用/禁用时尚模式时的宽度动画 8. 验证时尚模式下 dock 排除区域包含浮动边距 9. 在不同屏幕尺寸和 DPI 设置下进行测试 10. 验证左侧部分及其项目在时尚模式下是否隐藏 --- panels/dock/constants.h | 3 +- panels/dock/docksettings.cpp | 4 + panels/dock/package/FashionDockController.qml | 65 ++++++++++++++++ panels/dock/package/main.qml | 78 +++++++++++++++---- .../dock/showdesktop/package/showdesktop.qml | 10 ++- .../dock/taskmanager/package/TaskManager.qml | 10 ++- 6 files changed, 150 insertions(+), 20 deletions(-) create mode 100644 panels/dock/package/FashionDockController.qml diff --git a/panels/dock/constants.h b/panels/dock/constants.h index bf3cb9372..69fc3823b 100644 --- a/panels/dock/constants.h +++ b/panels/dock/constants.h @@ -1,6 +1,6 @@ // Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. // SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: LGPL-3.0-or-later @@ -36,6 +36,7 @@ enum IndicatorStyle { enum ItemAlignment { CenterAlignment = 0, LeftAlignment = 1, + FashionAlignment = 2, }; enum ColorTheme { diff --git a/panels/dock/docksettings.cpp b/panels/dock/docksettings.cpp index ac78af46f..575b60ccf 100644 --- a/panels/dock/docksettings.cpp +++ b/panels/dock/docksettings.cpp @@ -85,6 +85,8 @@ static QString itemAlignment2String(const ItemAlignment& alignment) return "left"; case ItemAlignment::CenterAlignment: return "center"; + case ItemAlignment::FashionAlignment: + return "fashion"; } return "center"; @@ -111,6 +113,8 @@ static ItemAlignment string2ItenAlignment(const QString& alignmentStr) return ItemAlignment::LeftAlignment; else if (alignmentStr == "center") return ItemAlignment::CenterAlignment; + else if (alignmentStr == "fashion") + return ItemAlignment::FashionAlignment; return ItemAlignment::CenterAlignment; } diff --git a/panels/dock/package/FashionDockController.qml b/panels/dock/package/FashionDockController.qml new file mode 100644 index 000000000..d6e80a810 --- /dev/null +++ b/panels/dock/package/FashionDockController.qml @@ -0,0 +1,65 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick 2.15 + +import org.deepin.ds 1.0 +import org.deepin.ds.dock 1.0 +import org.deepin.dtk.style 1.0 as DStyle + +QtObject { + id: root + + property bool useColumnLayout: false + property int itemAlignment: Dock.CenterAlignment + property int position: Dock.Bottom + property int hideState: Dock.Show + property real dockSize: 0 + property real dockItemIconSize: 0 + property real devicePixelRatio: 1 + property int screenWidth: 0 + property int colorTheme: Dock.Light + property bool dragging: false + property var gridLayout: null + property var rightPart: null + + readonly property bool enabled: !useColumnLayout + && itemAlignment === Dock.FashionAlignment + && (position === Dock.Bottom || position === Dock.Top) + readonly property bool topMode: enabled && position === Dock.Top + readonly property bool bottomMode: enabled && position === Dock.Bottom + readonly property int floatingMargin: 8 + readonly property int verticalPadding: Math.max(6, Math.round(dockSize * 0.16)) + readonly property int surfaceThickness: useColumnLayout ? dockSize : dockSize + verticalPadding * 2 + readonly property int backgroundRadius: Math.round(surfaceThickness / 4) + readonly property real gridDisplayedWidth: enabled && gridLayout + ? gridLayout.implicitWidth + : 0 + readonly property real gridDisplayedHeight: enabled && gridLayout + ? gridLayout.implicitHeight + : 0 + readonly property real contentWidth: { + if (!enabled) { + return 0 + } + + let width = gridDisplayedWidth + if (rightPart && rightPart.visible) { + if (width > 0) { + width += gridLayout.columnSpacing + } + width += rightPart.implicitWidth + } + return width + } + readonly property bool widthAnimationEnabled: enabled && !dragging + + function effectiveShellWidth() { + if (!enabled) { + return 0 + } + + return Math.min(contentWidth, screenWidth) + } +} diff --git a/panels/dock/package/main.qml b/panels/dock/package/main.qml index 68e8931e6..98f7a915c 100644 --- a/panels/dock/package/main.qml +++ b/panels/dock/package/main.qml @@ -13,19 +13,42 @@ import Qt.labs.platform as LP import org.deepin.ds 1.0 import org.deepin.ds.dock 1.0 import org.deepin.dtk 1.0 as D -import org.deepin.dtk.style 1.0 as DStyle Window { id: dock property int positionForAnimation: Panel.position property bool useColumnLayout: positionForAnimation % 2 + + FashionDockController { + id: fashionDockController + useColumnLayout: dock.useColumnLayout + itemAlignment: Panel.itemAlignment + position: dock.positionForAnimation + hideState: Panel.hideState + dockSize: dock.dockSize + dockItemIconSize: dock.dockItemIconSize + devicePixelRatio: Panel.devicePixelRatio > 0 ? Panel.devicePixelRatio : Screen.devicePixelRatio + screenWidth: Screen.width + colorTheme: Panel.colorTheme + dragging: dock.isDragging + gridLayout: gridLayout + rightPart: dockRightPart + } + + property alias fashionDock: fashionDockController property int dockCenterPartCount: dockCenterPartModel.count readonly property int dockRawCenterSpace: { if (useColumnLayout) { return Screen.height - dockLeftPart.implicitHeight - dockRightPart.implicitHeight; } else { - return Screen.width - dockLeftPart.implicitWidth - dockRightPart.implicitWidth; + let space = Screen.width - dockLeftPart.implicitWidth - dockRightPart.implicitWidth; + if (fashionDock.enabled && gridLayout) { + // 时尚模式下,dockRightPart 在 gridLayout 右侧,之间需要扣除 dockSpacing + // 这是为了确保 gridLayout 的宽度 + dockSpacing + rightPart 宽度 <= screenWidth + space -= Math.ceil(gridLayout.columnSpacing); + } + return Math.max(0, space); } } @@ -45,7 +68,13 @@ Window { property real dockItemIconSize: dockItemMaxSize * 9 / 14 // NOTE: -1 means not set its size, follow the platform size - width: positionForAnimation === Dock.Top || positionForAnimation === Dock.Bottom ? -1 : dockSize + width: { + if (fashionDock.enabled) { + return Math.max(1, fashionDock.effectiveShellWidth()) + } + + return positionForAnimation === Dock.Top || positionForAnimation === Dock.Bottom ? -1 : dockSize + } height: positionForAnimation === Dock.Left || positionForAnimation === Dock.Right ? -1 : dockSize color: "transparent" flags: Qt.WindowDoesNotAcceptFocus @@ -65,14 +94,21 @@ Window { MenuHelper.openMenu(dockMenuLoader.item) } - DLayerShellWindow.anchors: position2Anchors(positionForAnimation) + DLayerShellWindow.anchors: fashionDock.enabled + ? (fashionDock.topMode ? DLayerShellWindow.AnchorTop : DLayerShellWindow.AnchorBottom) + : position2Anchors(positionForAnimation) + DLayerShellWindow.topMargin: fashionDock.topMode ? fashionDock.floatingMargin : 0 + + DLayerShellWindow.bottomMargin: fashionDock.bottomMode ? fashionDock.floatingMargin : 0 DLayerShellWindow.layer: DLayerShellWindow.LayerTop - DLayerShellWindow.exclusionZone: Panel.hideMode === Dock.KeepShowing ? Applet.dockSize : 0 + DLayerShellWindow.exclusionZone: Panel.hideMode === Dock.KeepShowing + ? Applet.dockSize + (fashionDock.enabled ? fashionDock.floatingMargin : 0) + : 0 DLayerShellWindow.scope: "dde-shell/dock" DLayerShellWindow.keyboardInteractivity: DLayerShellWindow.KeyboardInteractivityOnDemand D.DWindow.enabled: true - D.DWindow.windowRadius: 0 + D.DWindow.windowRadius: fashionDock.enabled ? fashionDock.backgroundRadius : 0 //TODO:由于windoweffect处理有BUG,导致动画结束后一致保持无阴影,无borderwidth状态。 无法恢复到最初的阴影和边框 //D.DWindow.windowEffect: hideShowAnimation.running ? D.PlatformHandle.EffectNoShadow | D.PlatformHandle.EffectNoBorder : 0 @@ -89,12 +125,21 @@ Window { D.ColorSelector.family: D.Palette.CrystalColor onDockSizeChanged: { - if (dock.dockSize === Dock.MIN_DOCK_SIZE) { + if (fashionDock.enabled) { + Panel.indicatorStyle = Dock.Fashion + } else if (dock.dockSize === Dock.MIN_DOCK_SIZE) { Panel.indicatorStyle = Dock.Efficient } else { Panel.indicatorStyle = Dock.Fashion } } + Behavior on width { + enabled: fashionDock.widthAnimationEnabled + NumberAnimation { + duration: 200 + easing.type: Easing.OutQuad + } + } Binding on itemIconSizeBase { when: !isDragging @@ -326,6 +371,11 @@ Window { prop: "itemAlignment" value: Dock.CenterAlignment } + EnumPropertyMenuItem { + name: qsTr("Fashion Mode") + prop: "itemAlignment" + value: Dock.FashionAlignment + } } MutuallyExclusiveMenu { title: qsTr("Position") @@ -402,7 +452,7 @@ Window { D.StyledBehindWindowBlur { control: parent anchors.fill: parent - cornerRadius: 0 + cornerRadius: fashionDock.enabled ? fashionDock.backgroundRadius : 0 blendColor: { if (valid) { return DStyle.Style.control.selectColor(undefined, @@ -485,7 +535,7 @@ Window { //此处为边距区域的点击实践特殊处理。 MouseArea { id: leftMarginArea - width: useColumnLayout ? parent.width : gridLayout.columnSpacing + width: useColumnLayout ? parent.width : (fashionDock.enabled ? 0 : gridLayout.columnSpacing) height: useColumnLayout ? gridLayout.rowSpacing : parent.height anchors.left: parent.left anchors.top: parent.top @@ -514,13 +564,14 @@ Window { Item { id: leftMargin + visible: !fashionDock.enabled implicitWidth: 0 implicitHeight: 0 } Item { id: dockLeftPart - visible: dockLeftPartModel.count > 0 + visible: !fashionDock.enabled && dockLeftPartModel.count > 0 implicitWidth: leftLoader.implicitWidth implicitHeight: leftLoader.implicitHeight OverflowContainer { @@ -543,7 +594,7 @@ Window { Layout.maximumHeight: useColumnLayout ? dockRawCenterSpace : -1 onXChanged: dockCenterPartPosChanged() onYChanged: dockCenterPartPosChanged() - Layout.leftMargin: !useColumnLayout && Panel.itemAlignment === Dock.CenterAlignment ? + Layout.leftMargin: !useColumnLayout && !fashionDock.enabled && Panel.itemAlignment === Dock.CenterAlignment ? Math.max(0, (dock.width - dockCenterPart.implicitWidth) / 2 - (dockLeftPart.implicitWidth + 20) + Math.min((dock.width - dockCenterPart.implicitWidth) / 2 - (dockRightPart.implicitWidth + 20), 0)) : 0 Layout.topMargin: useColumnLayout && Panel.itemAlignment === Dock.CenterAlignment ? Math.max(0, (dock.height - dockCenterPart.implicitHeight) / 2 - (dockLeftPart.implicitHeight + 20) + Math.min((dock.height - dockCenterPart.implicitHeight) / 2 - (dockRightPart.implicitHeight + 20), 0)) : 0 @@ -578,8 +629,9 @@ Window { } Item { - Layout.fillWidth: true - Layout.fillHeight: true + Layout.fillWidth: !fashionDock.enabled + Layout.fillHeight: !fashionDock.enabled + visible: !fashionDock.enabled } } diff --git a/panels/dock/showdesktop/package/showdesktop.qml b/panels/dock/showdesktop/package/showdesktop.qml index cd3b18932..e0230b7ba 100644 --- a/panels/dock/showdesktop/package/showdesktop.qml +++ b/panels/dock/showdesktop/package/showdesktop.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -13,11 +13,13 @@ AppletItem { id: showdesktop readonly property int showDesktopWidth: 10 property bool useColumnLayout: Panel.position % 2 + readonly property bool fashionMode: Panel.rootObject && Panel.rootObject.fashionDock && Panel.rootObject.fashionDock.enabled property int dockSize: Panel.rootObject.dockItemMaxSize property int dockOrder: 30 - property bool shouldVisible: Applet.visible - implicitWidth: useColumnLayout ? Panel.rootObject.dockSize : showDesktopWidth - implicitHeight: useColumnLayout ? showDesktopWidth : Panel.rootObject.dockSize + property bool shouldVisible: Applet.visible && !fashionMode + visible: shouldVisible + implicitWidth: shouldVisible ? (useColumnLayout ? Panel.rootObject.dockSize : showDesktopWidth) : 0 + implicitHeight: shouldVisible ? (useColumnLayout ? showDesktopWidth : Panel.rootObject.dockSize) : 0 PanelToolTip { id: toolTip diff --git a/panels/dock/taskmanager/package/TaskManager.qml b/panels/dock/taskmanager/package/TaskManager.qml index 130bbc1be..30e30d4e3 100644 --- a/panels/dock/taskmanager/package/TaskManager.qml +++ b/panels/dock/taskmanager/package/TaskManager.qml @@ -14,6 +14,8 @@ ContainmentItem { id: taskmanager property bool useColumnLayout: Panel.rootObject.useColumnLayout property int dockOrder: 16 + readonly property bool fashionMode: Panel.rootObject && Panel.rootObject.fashionDock && Panel.rootObject.fashionDock.enabled + readonly property bool horizontalFashionMode: fashionMode && !useColumnLayout function calcRemainingSpace(baseSize) { const otherCount = Panel.rootObject.dockCenterPartCount - 1; @@ -21,7 +23,9 @@ ContainmentItem { return Panel.rootObject.dockRawCenterSpace - otherOccupied; } - readonly property real remainingSpacesForTaskManager: calcRemainingSpace(Panel.rootObject.dockItemMaxSize) + property real remainingSpacesForTaskManager: fashionMode + ? 0 + : calcRemainingSpace(Panel.rootObject.dockItemMaxSize) readonly property int appTitleSpacing: Math.max(10, Math.round(Panel.rootObject.dockItemMaxSize * 9 / 14) / 3) // Start padding for the app container so that the visual gap // (multitask icon right edge → first app icon left edge) = appTitleSpacing. @@ -37,12 +41,14 @@ ContainmentItem { readonly property real startPadding: Math.max(0, appTitleSpacing - (Panel.rootObject.dockItemMaxSize * (multitaskViewIconRatio - iconWidthToMaxSizeRatio) / 2)) implicitWidth: { + if (horizontalFashionMode) return appContainer.implicitWidth + (useColumnLayout ? 0 : startPadding) let extra = useColumnLayout ? 0 : startPadding let w = appContainer.implicitWidth + extra let maxW = Panel.itemAlignment === Dock.LeftAlignment ? Math.max(remainingSpacesForTaskManager, w) : Math.min(remainingSpacesForTaskManager, w) return useColumnLayout ? Panel.rootObject.dockSize : maxW } implicitHeight: { + if (fashionMode && useColumnLayout) return appContainer.implicitHeight + (useColumnLayout ? startPadding : 0) let extra = useColumnLayout ? startPadding : 0 let h = appContainer.implicitHeight + extra let maxH = Panel.itemAlignment === Dock.LeftAlignment ? Math.max(remainingSpacesForTaskManager, h) : Math.min(remainingSpacesForTaskManager, h) @@ -81,7 +87,7 @@ ContainmentItem { TextCalculator { id: textCalculator - enabled: taskmanager.Applet.windowSplit && (Panel.position == Dock.Bottom || Panel.position == Dock.Top) + enabled: !fashionMode && taskmanager.Applet.windowSplit && (Panel.position == Dock.Bottom || Panel.position == Dock.Top) dataModel: taskmanager.Applet.dataModel iconSize: Panel.rootObject.dockSize * 9 / 14 spacing: Math.max(10, Math.round(textCalculator.iconSize) / 3) From 744e6cf5ee66fa053a38d391f94f1133bf66977e Mon Sep 17 00:00:00 2001 From: wjyrich Date: Mon, 6 Jul 2026 14:41:54 +0800 Subject: [PATCH 2/2] feat: add card-type plugin support to dock panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Add Card plugin type to TrayPluginType enum in constants.h 2. Create CardLeftDockArea QML component for displaying card-type plugins in a carousel 3. Integrate card plugin surfaces into DockCompositor lifecycle (add/ remove/find) 4. Implement card area with left-side dock placement, using current/ index navigation 5. Support hover effects, page indicators, and wheel navigation for card area 6. Replace legacy left plugin area with CardLeftDockArea when card plugins exist Log: Added card-type plugin display area with carousel navigation in dock Influence: 1. Test card plugin registration and display in dock left area 2. Verify card plugin area visibility only when card plugins exist 3. Test mouse wheel navigation through card plugin pages 4. Verify hover effects and page indicator behavior 5. Test card plugin surface geometry updates on resize 6. Verify compatibility with existing tray/quick/fixed plugin types 7. Test card area behavior in both horizontal and vertical dock modes 8. Verify area width adapts to dock size and card content feat: 为任务栏添加卡片类型插件支持 1. 在 constants.h 中添加 Card 插件类型到 TrayPluginType 枚举 2. 创建 CardLeftDockArea QML 组件,用于以轮播方式显示卡片类型插件 3. 将卡片插件表面集成到 DockCompositor 的生命周期(添加/移除/查找) 4. 实现左侧任务栏卡片区域,支持当前索引/导航 5. 支持悬停效果、页面指示器和鼠标滚轮导航 6. 当存在卡片插件时,用 CardLeftDockArea 替换传统的左侧插件区域 Log: 新增卡片类型插件显示区域,支持轮播导航 Influence: 1. 测试卡片插件的注册和在任务栏左侧区域的显示 2. 验证卡片插件区域仅在存在卡片插件时可见 3. 测试通过鼠标滚轮在卡片插件页面间导航 4. 验证悬停效果和页面指示器的行为 5. 测试卡片插件表面在窗口大小调整时的几何更新 6. 验证与现有托盘/快捷/固定插件类型的兼容性 7. 测试卡片区域在任务栏水平和垂直模式下的表现 8. 验证区域宽度根据任务栏尺寸和卡片内容自适应 PMS: TASK-392671 --- debian/control | 10 +- panels/dock/CMakeLists.txt | 2 + panels/dock/DockCompositor.qml | 6 + .../dock/{tray => }/ShellSurfaceItemProxy.qml | 2 +- panels/dock/cardleft/CMakeLists.txt | 5 + .../cardleft/package/CardLeftDockArea.qml | 216 ++++++++++++++++++ panels/dock/cardleft/package/metadata.json | 8 + panels/dock/constants.h | 1 + panels/dock/dockpanel.cpp | 11 + panels/dock/dockpanel.h | 4 + panels/dock/package/FashionDockController.qml | 65 ------ panels/dock/package/main.qml | 80 ++++--- .../dock/showdesktop/package/showdesktop.qml | 3 +- .../dock/taskmanager/package/TaskManager.qml | 7 +- panels/dock/tray/CMakeLists.txt | 1 - .../ActionLegacyTrayPluginDelegate.qml | 2 +- panels/dock/tray/quickpanel/DragItem.qml | 1 + panels/dock/tray/quickpanel/PluginItem.qml | 3 +- panels/dock/tray/quickpanel/SubPluginPage.qml | 3 +- 19 files changed, 322 insertions(+), 108 deletions(-) rename panels/dock/{tray => }/ShellSurfaceItemProxy.qml (99%) create mode 100644 panels/dock/cardleft/CMakeLists.txt create mode 100644 panels/dock/cardleft/package/CardLeftDockArea.qml create mode 100644 panels/dock/cardleft/package/metadata.json delete mode 100644 panels/dock/package/FashionDockController.qml diff --git a/debian/control b/debian/control index 30bd77b83..ca2767baa 100644 --- a/debian/control +++ b/debian/control @@ -89,7 +89,10 @@ Breaks: dde-clipboard (<< 1:6.0.14), libdde-shell-dev (<< 2.0.38) Replaces: libdde-shell-dev (<< 2.0.38) -Description: An wrapper for developed based on dde-shell plugin system +Description: desktop shell and plugin host for DDE + DDE Shell provides the desktop shell infrastructure used by the Deepin + Desktop Environment and hosts components implemented through its plugin + system, including panels and other desktop user-interface elements. Package: dde-shell-example Architecture: any @@ -99,8 +102,9 @@ Depends: ${misc:Depends}, ${shlibs:Depends}, Multi-Arch: same -Description: DDE Shell example - This package contains some plugins based on dde-shell plugin system. +Description: example plugins for the DDE desktop shell + This package contains example plugins that demonstrate how to develop and + integrate components with the DDE Shell plugin system. Package: libdde-shell-dev Architecture: any diff --git a/panels/dock/CMakeLists.txt b/panels/dock/CMakeLists.txt index 16d6aa5e0..e1711e171 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/DockCompositor.qml b/panels/dock/DockCompositor.qml index e206ee7a4..9d58d5b18 100644 --- a/panels/dock/DockCompositor.qml +++ b/panels/dock/DockCompositor.qml @@ -30,6 +30,7 @@ Item { property ListModel trayPluginSurfaces: ListModel {} property ListModel quickPluginSurfaces: ListModel {} property ListModel fixedPluginSurfaces: ListModel {} + property ListModel cardPluginSurfaces: ListModel {} property var compositor: waylandCompositor property var panelScale: 1.0 @@ -62,6 +63,7 @@ Item { let ret = findSurfaceFromModel(trayPluginSurfaces, surfaceId) if (ret === null) ret = findSurfaceFromModel(quickPluginSurfaces, surfaceId) if (ret === null) ret = findSurfaceFromModel(fixedPluginSurfaces, surfaceId) + if (ret === null) ret = findSurfaceFromModel(cardPluginSurfaces, surfaceId) return ret } @@ -92,6 +94,8 @@ Item { quickPluginSurfaces.append({shellSurface: dockPluginSurface}) } else if (dockPluginSurface.pluginType === Dock.Fixed) { fixedPluginSurfaces.append({shellSurface: dockPluginSurface}) + } else if (dockPluginSurface.pluginType === Dock.Card) { + cardPluginSurfaces.append({shellSurface: dockPluginSurface}) } dockCompositor.pluginSurfacesUpdated() } @@ -104,6 +108,8 @@ Item { removeDockPluginSurface(quickPluginSurfaces, dockPluginSurface) } else if (dockPluginSurface.pluginType === Dock.Fixed) { removeDockPluginSurface(fixedPluginSurfaces, dockPluginSurface) + } else if (dockPluginSurface.pluginType === Dock.Card) { + removeDockPluginSurface(cardPluginSurfaces, dockPluginSurface) } dockCompositor.pluginSurfacesUpdated() } 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 fe0af9f15..7c9744247 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/cardleft/CMakeLists.txt b/panels/dock/cardleft/CMakeLists.txt new file mode 100644 index 000000000..a049b858f --- /dev/null +++ b/panels/dock/cardleft/CMakeLists.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: GPL-3.0-or-later + +ds_install_package(PACKAGE org.deepin.ds.dock.cardleft) diff --git a/panels/dock/cardleft/package/CardLeftDockArea.qml b/panels/dock/cardleft/package/CardLeftDockArea.qml new file mode 100644 index 000000000..9f9fa150b --- /dev/null +++ b/panels/dock/cardleft/package/CardLeftDockArea.qml @@ -0,0 +1,216 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Window 2.15 +import QtWayland.Compositor + +import org.deepin.ds 1.0 +import org.deepin.ds.dock 1.0 +import org.deepin.dtk 1.0 as D + +AppletDockItem { + id: root + + readonly property bool fashionMode: Panel.fashionMode + readonly property int dockSize: Panel.rootObject.dockSize + readonly property int hoverInset: 3 + readonly property real taskbarRadius: Panel.rootObject.fashionDock.backgroundRadius + readonly property real hoverBackgroundRadius: taskbarRadius - hoverInset + readonly property int adaptiveCardLeftWidth: 150 + Math.max(0, dockSize / 4) + readonly property int rightContentPadding: Math.max(10, Math.round(adaptiveCardLeftWidth * 0.07)) + readonly property int verticalInset: Math.max(5, Math.round(dockSize * 0.16)) + readonly property int pageContentHeight: Math.max(24, dockSize - verticalInset * 2) + + readonly property color primaryTextColor: Panel.colorTheme === Dock.Dark + ? Qt.rgba(1, 1, 1, 0.96) + : Qt.rgba(0, 0, 0, 0.92) + + dockOrder: 5 + shouldVisible: fashionMode && pageCount > 0 + readonly property int pageCount: DockCompositor.cardPluginSurfaces.count + property bool contentHovered: false + readonly property bool effectiveHovered: rootHoverHandler.hovered || contentHovered + + visible: shouldVisible + implicitWidth: adaptiveCardLeftWidth + implicitHeight: dockSize + clip: true + + function updateContentHovered() { + const item = swipeView.currentItem + contentHovered = !!item && item.surfaceHovered + } + + HoverHandler { + id: rootHoverHandler + acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus + } + + AppletItemBackground { + x: root.hoverInset + y: root.hoverInset + width: parent.width - root.hoverInset + height: parent.height - root.hoverInset * 2 + radius: root.hoverBackgroundRadius + enabled: false + opacity: root.effectiveHovered ? 1 : 0 + D.ColorSelector.hovered: root.effectiveHovered + + Behavior on opacity { + NumberAnimation { + duration: 150 + easing.type: Easing.OutCubic + } + } + } + + Item { + anchors.right: parent.right + anchors.rightMargin: 8 + anchors.verticalCenter: parent.verticalCenter + visible: root.effectiveHovered && root.pageCount > 1 + width: pageIndicator.implicitHeight + height: pageIndicator.implicitWidth + + PageIndicator { + id: pageIndicator + + anchors.centerIn: parent + rotation: 90 + count: swipeView.count + currentIndex: swipeView.currentIndex + padding: 0 + spacing: 4 + + delegate: Rectangle { + required property int index + + implicitWidth: 2 + implicitHeight: 2 + radius: width / 2 + color: root.primaryTextColor + opacity: index === pageIndicator.currentIndex ? 1 : 0.35 + } + } + } + + SwipeView { + id: swipeView + + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + anchors.leftMargin: 8 + anchors.rightMargin: root.rightContentPadding + height: root.pageContentHeight + orientation: Qt.Vertical + interactive: count > 1 + clip: true + + onCurrentItemChanged: { + root.updateContentHovered() + surfaceGeometryUpdateTimer.restart() + } + + Repeater { + model: DockCompositor.cardPluginSurfaces + + delegate: Item { + id: surfaceHost + + property var plugin: model.shellSurface + readonly property bool surfaceHovered: SwipeView.isCurrentItem && surfaceItem.hovered + + ShellSurfaceItemProxy { + id: surfaceItem + width: parent.width + height: parent.height + shellSurface: surfaceHost.plugin + } + + function updateSurfaceGeometry() { + if (!plugin || !SwipeView.isCurrentItem || !surfaceHost.Window.window) { + return + } + + const window = surfaceHost.Window.window + const windowPosition = surfaceHost.mapToItem(window.contentItem, 0, 0) + const globalPosition = Qt.point(windowPosition.x + window.x, + windowPosition.y + window.y) + + plugin.updatePluginGeometry(Qt.rect(Math.round(windowPosition.x), + Math.round(windowPosition.y), + Math.round(width), + Math.round(height))) + plugin.setGlobalPos(Qt.point(Math.round(globalPosition.x), + Math.round(globalPosition.y))) + surfaceItem.fixPosition() + } + + Component.onCompleted: updateSurfaceGeometry() + onWidthChanged: geometryUpdateTimer.restart() + onHeightChanged: geometryUpdateTimer.restart() + onVisibleChanged: { + geometryUpdateTimer.restart() + root.updateContentHovered() + } + onSurfaceHoveredChanged: root.updateContentHovered() + + Timer { + id: geometryUpdateTimer + interval: 50 + repeat: false + onTriggered: surfaceHost.updateSurfaceGeometry() + } + } + } + } + + Item { + anchors.fill: parent + z: 1 + + WheelHandler { + target: null + enabled: swipeView.count > 1 + acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad + + onWheel: function(wheel) { + const deltaY = wheel.angleDelta.y !== 0 ? wheel.angleDelta.y : wheel.pixelDelta.y + if (deltaY === 0) { + return + } + + const step = deltaY < 0 ? 1 : -1 + const nextIndex = (swipeView.currentIndex + step + swipeView.count) % swipeView.count + swipeView.setCurrentIndex(nextIndex) + wheel.accepted = true + } + } + } + + Connections { + target: swipeView.contentItem + ignoreUnknownSignals: true + + function onContentYChanged() { + surfaceGeometryUpdateTimer.restart() + } + } + + Timer { + id: surfaceGeometryUpdateTimer + + interval: 50 + repeat: false + onTriggered: { + const item = swipeView.currentItem + if (item) { + item.updateSurfaceGeometry() + } + } + } +} diff --git a/panels/dock/cardleft/package/metadata.json b/panels/dock/cardleft/package/metadata.json new file mode 100644 index 000000000..b18a9e068 --- /dev/null +++ b/panels/dock/cardleft/package/metadata.json @@ -0,0 +1,8 @@ +{ + "Plugin": { + "Version": "1.0", + "Id": "org.deepin.ds.dock.cardleft", + "Url": "CardLeftDockArea.qml", + "Parent": "org.deepin.ds.dock" + } +} diff --git a/panels/dock/constants.h b/panels/dock/constants.h index 69fc3823b..7a91c210d 100644 --- a/panels/dock/constants.h +++ b/panels/dock/constants.h @@ -80,6 +80,7 @@ enum TrayPluginType { Tray = 1, Fixed, Quick, + Card, }; enum TrayPluginSizePolicy { diff --git a/panels/dock/dockpanel.cpp b/panels/dock/dockpanel.cpp index 15754ac12..2e0de0287 100644 --- a/panels/dock/dockpanel.cpp +++ b/panels/dock/dockpanel.cpp @@ -100,6 +100,7 @@ bool DockPanel::init() }); connect(SETTINGS, &DockSettings::positionChanged, this, [this, dockDaemonAdaptor](){ Q_EMIT positionChanged(position()); + Q_EMIT fashionModeChanged(); Q_EMIT dockDaemonAdaptor->PositionChanged(position()); Q_EMIT dockDaemonAdaptor->FrontendWindowRectChanged(frontendWindowRect()); @@ -117,6 +118,9 @@ bool DockPanel::init() connect(SETTINGS, &DockSettings::dockSizeChanged, this, &DockPanel::dockSizeChanged); connect(SETTINGS, &DockSettings::hideModeChanged, this, &DockPanel::hideModeChanged); connect(SETTINGS, &DockSettings::itemAlignmentChanged, this, &DockPanel::itemAlignmentChanged); + connect(SETTINGS, &DockSettings::itemAlignmentChanged, this, [this](){ + Q_EMIT fashionModeChanged(); + }); connect(SETTINGS, &DockSettings::indicatorStyleChanged, this, &DockPanel::indicatorStyleChanged); connect(SETTINGS, &DockSettings::lockedChanged, this, &DockPanel::lockedChanged); @@ -298,6 +302,13 @@ void DockPanel::setItemAlignment(const ItemAlignment& alignment) SETTINGS->setItemAlignment(alignment); } +bool DockPanel::fashionMode() +{ + const auto dockPosition = position(); + return itemAlignment() == FashionAlignment + && (dockPosition == Top || dockPosition == Bottom); +} + IndicatorStyle DockPanel::indicatorStyle() { return SETTINGS->indicatorStyle(); diff --git a/panels/dock/dockpanel.h b/panels/dock/dockpanel.h index e6106f117..ed70895e8 100644 --- a/panels/dock/dockpanel.h +++ b/panels/dock/dockpanel.h @@ -30,6 +30,7 @@ class DockPanel : public DS_NAMESPACE::DPanel, public QDBusContext Q_PROPERTY(HideMode hideMode READ hideMode WRITE setHideMode NOTIFY hideModeChanged FINAL) Q_PROPERTY(Position position READ position WRITE setPosition NOTIFY positionChanged FINAL) Q_PROPERTY(ItemAlignment itemAlignment READ itemAlignment WRITE setItemAlignment NOTIFY itemAlignmentChanged FINAL) + Q_PROPERTY(bool fashionMode READ fashionMode NOTIFY fashionModeChanged FINAL) Q_PROPERTY(IndicatorStyle indicatorStyle READ indicatorStyle WRITE setIndicatorStyle NOTIFY indicatorStyleChanged FINAL) Q_PROPERTY(bool showInPrimary READ showInPrimary WRITE setShowInPrimary NOTIFY showInPrimaryChanged FINAL) Q_PROPERTY(QString screenName READ screenName NOTIFY screenNameChanged FINAL) @@ -72,6 +73,8 @@ class DockPanel : public DS_NAMESPACE::DPanel, public QDBusContext ItemAlignment itemAlignment(); void setItemAlignment(const ItemAlignment& alignment); + bool fashionMode(); + IndicatorStyle indicatorStyle(); void setIndicatorStyle(const IndicatorStyle& style); @@ -127,6 +130,7 @@ private Q_SLOTS: void beforePositionChanged(Position beforePosition); void positionChanged(Position position); void itemAlignmentChanged(ItemAlignment alignment); + void fashionModeChanged(); void indicatorStyleChanged(IndicatorStyle style); void showInPrimaryChanged(bool showInPrimary); void dockScreenChanged(QScreen *screen); diff --git a/panels/dock/package/FashionDockController.qml b/panels/dock/package/FashionDockController.qml deleted file mode 100644 index d6e80a810..000000000 --- a/panels/dock/package/FashionDockController.qml +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -import QtQuick 2.15 - -import org.deepin.ds 1.0 -import org.deepin.ds.dock 1.0 -import org.deepin.dtk.style 1.0 as DStyle - -QtObject { - id: root - - property bool useColumnLayout: false - property int itemAlignment: Dock.CenterAlignment - property int position: Dock.Bottom - property int hideState: Dock.Show - property real dockSize: 0 - property real dockItemIconSize: 0 - property real devicePixelRatio: 1 - property int screenWidth: 0 - property int colorTheme: Dock.Light - property bool dragging: false - property var gridLayout: null - property var rightPart: null - - readonly property bool enabled: !useColumnLayout - && itemAlignment === Dock.FashionAlignment - && (position === Dock.Bottom || position === Dock.Top) - readonly property bool topMode: enabled && position === Dock.Top - readonly property bool bottomMode: enabled && position === Dock.Bottom - readonly property int floatingMargin: 8 - readonly property int verticalPadding: Math.max(6, Math.round(dockSize * 0.16)) - readonly property int surfaceThickness: useColumnLayout ? dockSize : dockSize + verticalPadding * 2 - readonly property int backgroundRadius: Math.round(surfaceThickness / 4) - readonly property real gridDisplayedWidth: enabled && gridLayout - ? gridLayout.implicitWidth - : 0 - readonly property real gridDisplayedHeight: enabled && gridLayout - ? gridLayout.implicitHeight - : 0 - readonly property real contentWidth: { - if (!enabled) { - return 0 - } - - let width = gridDisplayedWidth - if (rightPart && rightPart.visible) { - if (width > 0) { - width += gridLayout.columnSpacing - } - width += rightPart.implicitWidth - } - return width - } - readonly property bool widthAnimationEnabled: enabled && !dragging - - function effectiveShellWidth() { - if (!enabled) { - return 0 - } - - return Math.min(contentWidth, screenWidth) - } -} diff --git a/panels/dock/package/main.qml b/panels/dock/package/main.qml index 98f7a915c..7b90d789d 100644 --- a/panels/dock/package/main.qml +++ b/panels/dock/package/main.qml @@ -19,23 +19,34 @@ Window { property int positionForAnimation: Panel.position property bool useColumnLayout: positionForAnimation % 2 - FashionDockController { - id: fashionDockController - useColumnLayout: dock.useColumnLayout - itemAlignment: Panel.itemAlignment - position: dock.positionForAnimation - hideState: Panel.hideState - dockSize: dock.dockSize - dockItemIconSize: dock.dockItemIconSize - devicePixelRatio: Panel.devicePixelRatio > 0 ? Panel.devicePixelRatio : Screen.devicePixelRatio - screenWidth: Screen.width - colorTheme: Panel.colorTheme - dragging: dock.isDragging - gridLayout: gridLayout - rightPart: dockRightPart - } + property alias fashionDock: fashionDockState + + QtObject { + id: fashionDockState - property alias fashionDock: fashionDockController + readonly property bool enabled: !dock.useColumnLayout + && Panel.itemAlignment === Dock.FashionAlignment + && (dock.positionForAnimation === Dock.Bottom || dock.positionForAnimation === Dock.Top) + readonly property int floatingMargin: 8 + readonly property int backgroundRadius: { + const verticalPadding = Math.max(6, Math.round(dock.dockSize * 0.16)) + return Math.round((dock.dockSize + verticalPadding * 2) / 4) + } + readonly property real contentWidth: { + if (!enabled) { + return 0 + } + + let width = gridLayout.implicitWidth + if (dockRightPart.visible) { + if (width > 0) { + width += gridLayout.columnSpacing + } + width += dockRightPart.implicitWidth + } + return width + } + } property int dockCenterPartCount: dockCenterPartModel.count readonly property int dockRawCenterSpace: { @@ -45,8 +56,8 @@ Window { let space = Screen.width - dockLeftPart.implicitWidth - dockRightPart.implicitWidth; if (fashionDock.enabled && gridLayout) { // 时尚模式下,dockRightPart 在 gridLayout 右侧,之间需要扣除 dockSpacing - // 这是为了确保 gridLayout 的宽度 + dockSpacing + rightPart 宽度 <= screenWidth - space -= Math.ceil(gridLayout.columnSpacing); + // 同时保留左右悬浮间距,避免窗口铺满屏幕后圆角边框被屏幕边缘裁剪。 + space -= Math.ceil(gridLayout.columnSpacing) + fashionDock.floatingMargin * 2; } return Math.max(0, space); } @@ -70,7 +81,8 @@ Window { // NOTE: -1 means not set its size, follow the platform size width: { if (fashionDock.enabled) { - return Math.max(1, fashionDock.effectiveShellWidth()) + const maximumWidth = Math.max(1, Screen.width - fashionDock.floatingMargin * 2) + return Math.max(1, Math.min(fashionDock.contentWidth, maximumWidth)) } return positionForAnimation === Dock.Top || positionForAnimation === Dock.Bottom ? -1 : dockSize @@ -95,11 +107,15 @@ Window { } DLayerShellWindow.anchors: fashionDock.enabled - ? (fashionDock.topMode ? DLayerShellWindow.AnchorTop : DLayerShellWindow.AnchorBottom) + ? (positionForAnimation === Dock.Top ? DLayerShellWindow.AnchorTop : DLayerShellWindow.AnchorBottom) : position2Anchors(positionForAnimation) - DLayerShellWindow.topMargin: fashionDock.topMode ? fashionDock.floatingMargin : 0 + DLayerShellWindow.topMargin: fashionDock.enabled && positionForAnimation === Dock.Top + ? fashionDock.floatingMargin + : 0 - DLayerShellWindow.bottomMargin: fashionDock.bottomMode ? fashionDock.floatingMargin : 0 + DLayerShellWindow.bottomMargin: fashionDock.enabled && positionForAnimation === Dock.Bottom + ? fashionDock.floatingMargin + : 0 DLayerShellWindow.layer: DLayerShellWindow.LayerTop DLayerShellWindow.exclusionZone: Panel.hideMode === Dock.KeepShowing ? Applet.dockSize + (fashionDock.enabled ? fashionDock.floatingMargin : 0) @@ -134,7 +150,7 @@ Window { } } Behavior on width { - enabled: fashionDock.widthAnimationEnabled + enabled: fashionDock.enabled && !dock.isDragging NumberAnimation { duration: 200 easing.type: Easing.OutQuad @@ -150,7 +166,7 @@ Window { PropertyAnimation { id: hideShowAnimation; // Currently, Wayland (Treeland) doesn't support StyledBehindWindowBlur inside the window, thus we keep using the window size approach on Wayland - property bool useTransformBasedAnimation: Qt.platform.pluginName === "xcb" + property bool useTransformBasedAnimation: Qt.platform.pluginName === "xcb" && !fashionDock.enabled target: useTransformBasedAnimation ? dockTransform : dock; property: { if (useTransformBasedAnimation) return dock.useColumnLayout ? "x" : "y"; @@ -176,7 +192,7 @@ Window { Connections { target: dockTransform - enabled: Qt.platform.pluginName === "xcb" && hideShowAnimation.running + enabled: hideShowAnimation.useTransformBasedAnimation && hideShowAnimation.running function onXChanged() { if (dock.useColumnLayout) { @@ -193,7 +209,7 @@ Window { Connections { target: dock - enabled: Qt.platform.pluginName !== "xcb" && hideShowAnimation.running + enabled: !hideShowAnimation.useTransformBasedAnimation && hideShowAnimation.running function onWidthChanged() { if (dock.useColumnLayout) { @@ -221,7 +237,7 @@ Window { SequentialAnimation { id: dockAnimation - property bool useTransformBasedAnimation: Qt.platform.pluginName === "xcb" + property bool useTransformBasedAnimation: Qt.platform.pluginName === "xcb" && !fashionDock.enabled property bool isShowing: false property bool isPositionChanging: false property var target: useTransformBasedAnimation ? dockTransform : dock @@ -554,7 +570,12 @@ Window { // TODO: remove GridLayout and use delegatechosser manager all items GridLayout { id: gridLayout - anchors.fill: parent + anchors { + fill: parent + rightMargin: fashionDock.enabled && dockRightPart.visible + ? dockRightPart.implicitWidth + Math.ceil(gridLayout.columnSpacing) + : 0 + } columns: 1 rows: 1 flow: useColumnLayout ? GridLayout.LeftToRight : GridLayout.TopToBottom @@ -571,9 +592,10 @@ Window { Item { id: dockLeftPart - visible: !fashionDock.enabled && dockLeftPartModel.count > 0 + visible: dockLeftPartModel.count > 0 implicitWidth: leftLoader.implicitWidth implicitHeight: leftLoader.implicitHeight + OverflowContainer { id: leftLoader anchors.fill: parent diff --git a/panels/dock/showdesktop/package/showdesktop.qml b/panels/dock/showdesktop/package/showdesktop.qml index e0230b7ba..8e8880062 100644 --- a/panels/dock/showdesktop/package/showdesktop.qml +++ b/panels/dock/showdesktop/package/showdesktop.qml @@ -13,8 +13,7 @@ AppletItem { id: showdesktop readonly property int showDesktopWidth: 10 property bool useColumnLayout: Panel.position % 2 - readonly property bool fashionMode: Panel.rootObject && Panel.rootObject.fashionDock && Panel.rootObject.fashionDock.enabled - property int dockSize: Panel.rootObject.dockItemMaxSize + readonly property bool fashionMode: Panel.fashionMode property int dockOrder: 30 property bool shouldVisible: Applet.visible && !fashionMode visible: shouldVisible diff --git a/panels/dock/taskmanager/package/TaskManager.qml b/panels/dock/taskmanager/package/TaskManager.qml index 30e30d4e3..964743a18 100644 --- a/panels/dock/taskmanager/package/TaskManager.qml +++ b/panels/dock/taskmanager/package/TaskManager.qml @@ -14,8 +14,7 @@ ContainmentItem { id: taskmanager property bool useColumnLayout: Panel.rootObject.useColumnLayout property int dockOrder: 16 - readonly property bool fashionMode: Panel.rootObject && Panel.rootObject.fashionDock && Panel.rootObject.fashionDock.enabled - readonly property bool horizontalFashionMode: fashionMode && !useColumnLayout + readonly property bool fashionMode: Panel.fashionMode function calcRemainingSpace(baseSize) { const otherCount = Panel.rootObject.dockCenterPartCount - 1; @@ -41,14 +40,14 @@ ContainmentItem { readonly property real startPadding: Math.max(0, appTitleSpacing - (Panel.rootObject.dockItemMaxSize * (multitaskViewIconRatio - iconWidthToMaxSizeRatio) / 2)) implicitWidth: { - if (horizontalFashionMode) return appContainer.implicitWidth + (useColumnLayout ? 0 : startPadding) + if (fashionMode) return appContainer.implicitWidth + (useColumnLayout ? 0 : startPadding) let extra = useColumnLayout ? 0 : startPadding let w = appContainer.implicitWidth + extra let maxW = Panel.itemAlignment === Dock.LeftAlignment ? Math.max(remainingSpacesForTaskManager, w) : Math.min(remainingSpacesForTaskManager, w) return useColumnLayout ? Panel.rootObject.dockSize : maxW } implicitHeight: { - if (fashionMode && useColumnLayout) return appContainer.implicitHeight + (useColumnLayout ? startPadding : 0) + if (fashionMode && useColumnLayout) return appContainer.implicitHeight + startPadding let extra = useColumnLayout ? startPadding : 0 let h = appContainer.implicitHeight + extra let maxH = Panel.itemAlignment === Dock.LeftAlignment ? Math.max(remainingSpacesForTaskManager, h) : Math.min(remainingSpacesForTaskManager, h) 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 7db47f8c8..7045641f3 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 {