Skip to content
Merged
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
13 changes: 6 additions & 7 deletions panels/dock/taskmanager/package/TaskManager.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ ContainmentItem {
model: DelegateModel {
id: visualModel
model: taskmanager.Applet.dataModel
// 1:4 the distance between app : dock height; get width/height≈0.8
property real cellWidth: Panel.rootObject.dockItemMaxSize * 0.8
delegate: DropArea {
id: delegateRoot
required property bool active
Expand Down Expand Up @@ -78,9 +80,8 @@ ContainmentItem {
Behavior on scale { NumberAnimation { duration: 200 } }

// TODO: 临时溢出逻辑,待后面修改
// 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
implicitWidth: useColumnLayout ? Panel.rootObject.dockItemMaxSize : visualModel.cellWidth
implicitHeight: useColumnLayout ? visualModel.cellWidth : Panel.rootObject.dockItemMaxSize

onEntered: function(drag) {
visualModel.items.move((drag.source as AppItem).visualIndex, app.visualIndex)
Expand Down Expand Up @@ -136,8 +137,7 @@ ContainmentItem {
onPositionChanged: function(drag) {
if (launcherDndDesktopId === "") return
let curX = taskmanager.useColumnLayout ? drag.y : drag.x
curX *= Screen.devicePixelRatio
let cellWidth = Panel.rootObject.dockItemMaxSize
let cellWidth = visualModel.cellWidth
let curCell = curX / cellWidth
let appId = taskmanager.Applet.desktopIdToAppId(launcherDndDesktopId)
taskmanager.Applet.dataModel.moveTo(appId, curCell)
Expand All @@ -146,8 +146,7 @@ ContainmentItem {
onDropped: function(drop) {
if (launcherDndDesktopId === "") return
let curX = taskmanager.useColumnLayout ? drop.y : drop.x
curX *= Screen.devicePixelRatio
let cellWidth = Panel.rootObject.dockItemMaxSize
let cellWidth = visualModel.cellWidth
let curCell = curX / cellWidth
let appId = taskmanager.Applet.desktopIdToAppId(launcherDndDesktopId)
taskmanager.Applet.dataModel.moveTo(appId, curCell)
Expand Down
Loading