Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions panels/dock/launcherItem/package/launcheritem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ AppletItem {
id: launcher
property bool useColumnLayout: Panel.position % 2
property int dockOrder: 12
implicitWidth: useColumnLayout ? Panel.rootObject.dockSize : Panel.rootObject.dockItemMaxSize
implicitHeight: useColumnLayout ? Panel.rootObject.dockItemMaxSize : Panel.rootObject.dockSize
// 1:4 the distance between app : dock height; get width/height≈0.8
implicitWidth: useColumnLayout ? Panel.rootObject.dockSize : Panel.rootObject.dockItemMaxSize * 0.8
implicitHeight: useColumnLayout ? Panel.rootObject.dockItemMaxSize * 0.8 : Panel.rootObject.dockSize

Connections {
target: Panel.rootObject
Expand Down Expand Up @@ -48,9 +49,9 @@ AppletItem {
anchors.centerIn: parent
icon.name: Applet.iconName
scale: Panel.rootObject.itemScale
// 10 : 36 : 10
icon.height: Panel.rootObject.itemIconSizeBase * 0.64
icon.width: Panel.rootObject.itemIconSizeBase * 0.64
// 9:14 (iconSize/dockHeight)
icon.height: Panel.rootObject.itemIconSizeBase * 0.643
icon.width: Panel.rootObject.itemIconSizeBase * 0.643
onClicked: {
Applet.toggleLauncher()
toolTip.close()
Expand Down
2 changes: 1 addition & 1 deletion panels/dock/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Window {
property real itemScale: 1.0
property real draggingSize: 0.0
property int itemIconSizeBase: 0
property int itemSpacing: dockItemMaxSize / 20
property int itemSpacing: 0

property bool isDragging: false

Expand Down
22 changes: 8 additions & 14 deletions panels/dock/taskmanager/package/AppItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ Item {
Drag.dragType: Drag.Automatic
Drag.mimeData: { "text/x-dde-dock-dnd-appid": itemId }

property int statusIndicatorSize: root.width * 0.8
property int iconSize: Panel.rootObject.itemIconSizeBase * 0.64
property bool useColumnLayout: Panel.position % 2
property int statusIndicatorSize: useColumnLayout ? root.width * 0.74 : root.height * 0.74
property int iconSize: Panel.rootObject.itemIconSizeBase * 0.643 // 9:14 (iconSize/dockHeight)

property var iconGlobalPoint: {
var a = icon
Expand Down Expand Up @@ -89,38 +90,31 @@ Item {
windowIndicator.anchors.rightMargin = 0
windowIndicator.anchors.horizontalCenter = undefined
windowIndicator.anchors.verticalCenter = undefined
let fixedDistance = 2

switch(Panel.position) {
case Dock.Top: {
windowIndicator.anchors.horizontalCenter = parent.horizontalCenter
windowIndicator.anchors.top = parent.top
windowIndicator.anchors.topMargin = Qt.binding(function() {
return Math.floor(root.width * 0.1) - 1
})
windowIndicator.anchors.topMargin = fixedDistance
return
}
case Dock.Bottom: {
windowIndicator.anchors.horizontalCenter = parent.horizontalCenter
windowIndicator.anchors.bottom = parent.bottom
windowIndicator.anchors.bottomMargin = Qt.binding(function() {
return Math.floor(root.width * 0.1) - 1
})
windowIndicator.anchors.bottomMargin = fixedDistance
return
}
case Dock.Left: {
windowIndicator.anchors.verticalCenter = parent.verticalCenter
windowIndicator.anchors.left = parent.left
windowIndicator.anchors.leftMargin = Qt.binding(function() {
return Math.floor(root.width * 0.1) - 1
})
windowIndicator.anchors.leftMargin = fixedDistance
return
}
case Dock.Right:{
windowIndicator.anchors.verticalCenter = parent.verticalCenter
windowIndicator.anchors.right = parent.right
windowIndicator.anchors.rightMargin = Qt.binding(function() {
return Math.floor(root.width * 0.1) - 1
})
windowIndicator.anchors.rightMargin = fixedDistance
return
}
}
Expand Down
5 changes: 3 additions & 2 deletions panels/dock/taskmanager/package/TaskManager.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ ContainmentItem {
required property list<string> windows

// TODO: 临时溢出逻辑,待后面修改
implicitWidth: Panel.rootObject.dockItemMaxSize
implicitHeight: Panel.rootObject.dockItemMaxSize
// 1:4 the distance between app : dock height; get width/height≈0.8
implicitWidth: useColumnLayout ? Panel.rootObject.dockItemMaxSize : Panel.rootObject.dockItemMaxSize * 0.8
implicitHeight: useColumnLayout ? Panel.rootObject.dockItemMaxSize * 0.8 : Panel.rootObject.dockItemMaxSize

onEntered: function(drag) {
visualModel.items.move((drag.source as AppItem).visualIndex, app.visualIndex)
Expand Down