@@ -16,13 +16,29 @@ ContainmentItem {
1616 property int dockOrder: 16
1717 property real remainingSpacesForTaskManager: Panel .rootObject .dockRemainingSpaceForCenter
1818 readonly property int appTitleSpacing: Math .max (10 , Math .round (Panel .rootObject .dockItemMaxSize * 9 / 14 ) / 3 )
19+ // Start padding for the app container so that the visual gap
20+ // (multitask icon right edge → first app icon left edge) = appTitleSpacing.
21+ // Compensates for the multitask view's box being wider than its icon.
22+ // 4/5 = 0.8: multitask button width relative to dockItemMaxSize.
23+ // Derived from the 1:4 spacing ratio (app icon : dock item height = 4:1, so content = 4/5 = 0.8).
24+ // Matches AppletDockItem.qml implicitWidth/Height ratio.
25+ readonly property real multitaskViewIconRatio: 0.8
26+ // 9/14 ≈ 0.64: app icon size relative to dockItemMaxSize (iconSize:dockHeight = 9:14).
27+ // Defined in main.qml as dockItemIconSize = dockItemMaxSize * 9 / 14.
28+ // At default dock size (56), icon = 36px; at min (37), icon ≈ 24px; at max (100), icon ≈ 64px.
29+ readonly property real iconWidthToMaxSizeRatio: 9 / 14
30+ readonly property real startPadding: Math .max (0 , appTitleSpacing - (Panel .rootObject .dockItemMaxSize * (multitaskViewIconRatio - iconWidthToMaxSizeRatio) / 2 ))
1931
2032 implicitWidth: {
21- let maxW = Panel .itemAlignment === Dock .LeftAlignment ? Math .max (remainingSpacesForTaskManager, appContainer .implicitWidth ) : Math .min (remainingSpacesForTaskManager, appContainer .implicitWidth )
33+ let extra = useColumnLayout ? 0 : startPadding
34+ let w = appContainer .implicitWidth + extra
35+ let maxW = Panel .itemAlignment === Dock .LeftAlignment ? Math .max (remainingSpacesForTaskManager, w) : Math .min (remainingSpacesForTaskManager, w)
2236 return useColumnLayout ? Panel .rootObject .dockSize : maxW
2337 }
2438 implicitHeight: {
25- let maxH = Panel .itemAlignment === Dock .LeftAlignment ? Math .max (remainingSpacesForTaskManager, appContainer .implicitHeight ) : Math .min (remainingSpacesForTaskManager, appContainer .implicitHeight )
39+ let extra = useColumnLayout ? startPadding : 0
40+ let h = appContainer .implicitHeight + extra
41+ let maxH = Panel .itemAlignment === Dock .LeftAlignment ? Math .max (remainingSpacesForTaskManager, h) : Math .min (remainingSpacesForTaskManager, h)
2642 return useColumnLayout ? maxH : Panel .rootObject .dockSize
2743 }
2844 // Helper function to find the current index of an app by its appId in the visualModel
@@ -72,6 +88,8 @@ ContainmentItem {
7288 OverflowContainer {
7389 id: appContainer
7490 anchors .fill : parent
91+ anchors .leftMargin : useColumnLayout ? 0 : taskmanager .startPadding
92+ anchors .topMargin : useColumnLayout ? taskmanager .startPadding : 0
7593 useColumnLayout: taskmanager .useColumnLayout
7694 spacing: taskmanager .appTitleSpacing
7795 remove: Transition {
0 commit comments