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 bf3cb9372..7a91c210d 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 { @@ -79,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/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/main.qml b/panels/dock/package/main.qml index 68e8931e6..7b90d789d 100644 --- a/panels/dock/package/main.qml +++ b/panels/dock/package/main.qml @@ -13,19 +13,53 @@ 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 + + property alias fashionDock: fashionDockState + + QtObject { + id: fashionDockState + + 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: { 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 + // 同时保留左右悬浮间距,避免窗口铺满屏幕后圆角边框被屏幕边缘裁剪。 + space -= Math.ceil(gridLayout.columnSpacing) + fashionDock.floatingMargin * 2; + } + return Math.max(0, space); } } @@ -45,7 +79,14 @@ 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) { + 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 + } height: positionForAnimation === Dock.Left || positionForAnimation === Dock.Right ? -1 : dockSize color: "transparent" flags: Qt.WindowDoesNotAcceptFocus @@ -65,14 +106,25 @@ Window { MenuHelper.openMenu(dockMenuLoader.item) } - DLayerShellWindow.anchors: position2Anchors(positionForAnimation) + DLayerShellWindow.anchors: fashionDock.enabled + ? (positionForAnimation === Dock.Top ? DLayerShellWindow.AnchorTop : DLayerShellWindow.AnchorBottom) + : position2Anchors(positionForAnimation) + DLayerShellWindow.topMargin: fashionDock.enabled && positionForAnimation === Dock.Top + ? 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 : 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 +141,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.enabled && !dock.isDragging + NumberAnimation { + duration: 200 + easing.type: Easing.OutQuad + } + } Binding on itemIconSizeBase { when: !isDragging @@ -105,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"; @@ -131,7 +192,7 @@ Window { Connections { target: dockTransform - enabled: Qt.platform.pluginName === "xcb" && hideShowAnimation.running + enabled: hideShowAnimation.useTransformBasedAnimation && hideShowAnimation.running function onXChanged() { if (dock.useColumnLayout) { @@ -148,7 +209,7 @@ Window { Connections { target: dock - enabled: Qt.platform.pluginName !== "xcb" && hideShowAnimation.running + enabled: !hideShowAnimation.useTransformBasedAnimation && hideShowAnimation.running function onWidthChanged() { if (dock.useColumnLayout) { @@ -176,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 @@ -326,6 +387,11 @@ Window { prop: "itemAlignment" value: Dock.CenterAlignment } + EnumPropertyMenuItem { + name: qsTr("Fashion Mode") + prop: "itemAlignment" + value: Dock.FashionAlignment + } } MutuallyExclusiveMenu { title: qsTr("Position") @@ -402,7 +468,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 +551,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 @@ -504,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 @@ -514,6 +585,7 @@ Window { Item { id: leftMargin + visible: !fashionDock.enabled implicitWidth: 0 implicitHeight: 0 } @@ -523,6 +595,7 @@ Window { visible: dockLeftPartModel.count > 0 implicitWidth: leftLoader.implicitWidth implicitHeight: leftLoader.implicitHeight + OverflowContainer { id: leftLoader anchors.fill: parent @@ -543,7 +616,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 +651,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..8e8880062 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,12 @@ AppletItem { id: showdesktop readonly property int showDesktopWidth: 10 property bool useColumnLayout: Panel.position % 2 - property int dockSize: Panel.rootObject.dockItemMaxSize + readonly property bool fashionMode: Panel.fashionMode 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..964743a18 100644 --- a/panels/dock/taskmanager/package/TaskManager.qml +++ b/panels/dock/taskmanager/package/TaskManager.qml @@ -14,6 +14,7 @@ ContainmentItem { id: taskmanager property bool useColumnLayout: Panel.rootObject.useColumnLayout property int dockOrder: 16 + readonly property bool fashionMode: Panel.fashionMode function calcRemainingSpace(baseSize) { const otherCount = Panel.rootObject.dockCenterPartCount - 1; @@ -21,7 +22,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 +40,14 @@ ContainmentItem { readonly property real startPadding: Math.max(0, appTitleSpacing - (Panel.rootObject.dockItemMaxSize * (multitaskViewIconRatio - iconWidthToMaxSizeRatio) / 2)) implicitWidth: { + 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 + 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) @@ -81,7 +86,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) 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 {