@@ -47,21 +47,56 @@ D.SortFilterModel {
4747 property var appletItem: model .data
4848 property var attachedAppletItem: null
4949 readonly property string pluginId: appletItem && appletItem .applet ? appletItem .applet .pluginId : " "
50+ readonly property bool isAiBarApplet: pluginId === " org.deepin.ds.dock.aibar"
51+ readonly property bool horizontalAiBarApplet: isAiBarApplet
52+ && Panel .viewMode === Dock .FashionMode
53+ && ! (Panel .rootObject && Panel .rootObject .useColumnLayout )
54+ readonly property int hoverInset: 4
5055 readonly property bool useUnifiedDockHoverBackground: [
5156 " org.deepin.ds.dock.launcherapplet" ,
5257 " org.deepin.ds.dock.aibar" ,
5358 " org.deepin.ds.dock.searchitem" ,
5459 " org.deepin.ds.dock.multitaskview"
5560 ].indexOf (pluginId) >= 0
56- readonly property int unifiedHoverBackgroundSize: Math .round ((Panel .rootObject ? Panel .rootObject .dockItemMaxSize * 9 / 14 : 0 ) + 8 )
57- implicitWidth: appletItem ? appletItem .implicitWidth : 0
61+ readonly property real aiBarIconSize: appletItem && appletItem .iconWidth !== undefined ? appletItem .iconWidth : 0
62+ readonly property real hoverTargetWidth: isAiBarApplet && aiBarIconSize > 0
63+ ? aiBarIconSize
64+ : (Panel .rootObject ? Panel .rootObject .dockItemMaxSize * 9 / 14 : 0 )
65+ readonly property real hoverTargetHeight: hoverTargetWidth
66+ readonly property real unifiedHoverBackgroundWidth: Math .round (hoverTargetWidth + hoverInset * 2 )
67+ readonly property real unifiedHoverBackgroundHeight: Math .round (hoverTargetHeight + hoverInset * 2 )
68+ readonly property real aiBarEdgeMargin: Panel .rootObject
69+ ? Math .max (0 , (Panel .rootObject .dockSize - hoverTargetHeight) / 2 )
70+ : 0
71+ readonly property real aiBarTrailingInset: Panel .rootObject ? Panel .rootObject .fashionVerticalPadding + 1 : 0
72+ readonly property real aiBarContentWidth: appletItem ? appletItem .implicitWidth : 0
73+ readonly property real aiBarLayoutWidth: horizontalAiBarApplet
74+ ? Math .max (aiBarContentWidth, hoverTargetWidth + aiBarEdgeMargin * 2 - aiBarTrailingInset)
75+ : aiBarContentWidth
76+ readonly property int aiBarHorizontalOffset: horizontalAiBarApplet
77+ ? Math .round (aiBarEdgeMargin)
78+ : 0
79+ readonly property real aiBarRightPadding: horizontalAiBarApplet
80+ ? Math .max (0 , aiBarLayoutWidth - aiBarContentWidth)
81+ : 0
82+ implicitWidth: appletItem ? aiBarLayoutWidth : 0
5883 implicitHeight: appletItem ? appletItem .implicitHeight : 0
84+ rightPadding: aiBarRightPadding
85+
86+ transform: Translate {
87+ x: delegateRoot .aiBarHorizontalOffset
88+ }
5989
6090 contentItem: appletItem
6191 background: AppletItemBackground {
62- anchors .centerIn : parent
63- width: delegateRoot .unifiedHoverBackgroundSize
64- height: delegateRoot .unifiedHoverBackgroundSize
92+ x: Math .round (! delegateRoot .isAiBarApplet || (Panel .rootObject && Panel .rootObject .useColumnLayout )
93+ ? (delegateRoot .width - width) / 2
94+ : delegateRoot .hoverInset * - 1 )
95+ y: Math .round (! delegateRoot .isAiBarApplet || ! (Panel .rootObject && Panel .rootObject .useColumnLayout )
96+ ? (delegateRoot .height - height) / 2
97+ : delegateRoot .hoverInset * - 1 )
98+ width: delegateRoot .unifiedHoverBackgroundWidth
99+ height: delegateRoot .unifiedHoverBackgroundHeight
65100 radius: height / 5
66101 enabled: false
67102 visible: delegateRoot .useUnifiedDockHoverBackground
0 commit comments