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
2 changes: 1 addition & 1 deletion panels/dock/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Window {

let otherOccupied = 0;
if (otherCount > 0) {
otherOccupied = otherCount * dockItemMaxSize + otherCount * spacing;
otherOccupied = otherCount * dockItemIconSize + otherCount * spacing;
}

if (useColumnLayout) {
Expand Down
2 changes: 1 addition & 1 deletion panels/dock/taskmanager/package/AppItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Item {
Drag.mimeData: { "text/x-dde-dock-dnd-appid": itemId, "text/x-dde-dock-dnd-source": "taskbar", "text/x-dde-dock-dnd-winid": windows.length > 0 ? windows[0] : ""}

property bool useColumnLayout: Panel.rootObject.useColumnLayout
property int iconSize: Panel.rootObject.dockItemMaxSize * 9 / 14
property real iconSize: Panel.rootObject.dockItemMaxSize * 9 / 14
property bool enableTitle: false
property bool titleActive: enableTitle && titleLoader.active
property var iconGlobalPoint: {
Expand Down
24 changes: 4 additions & 20 deletions panels/dock/taskmanager/package/TaskManager.qml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ ContainmentItem {
dataModel: taskmanager.Applet.dataModel
iconSize: Panel.rootObject.dockItemMaxSize * 9 / 14
spacing: appContainer.spacing
cellSize: visualModel.cellWidth
itemPadding: taskmanager.appTitleSpacing
cellSize: textCalculator.iconSize
itemPadding: Math.round(textCalculator.iconSize / 8)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Math.round(textCalculator.iconSize / 8) 这个是有特殊含义么?如果这样设置的话,qml中的布局,跟c++里的计算不一致了吧,之前都是用taskmanager.appTitleSpacing

remainingSpace: taskmanager.remainingSpacesForTaskManager
font.family: D.DTK.fontManager.t6.family
font.pixelSize: Math.max(10, Math.min(20, Math.round(textCalculator.iconSize * 0.35)))
Expand Down Expand Up @@ -132,24 +132,8 @@ ContainmentItem {
Behavior on opacity { NumberAnimation { duration: 200 } }
Behavior on scale { NumberAnimation { duration: 200 } }

implicitWidth: {
let targetW = useColumnLayout ? taskmanager.implicitWidth : appItem.implicitWidth;
if (useColumnLayout || visualModel.count <= 0) return targetW;

let totalSpacing = Math.max(0, visualModel.count - 1) * taskmanager.appTitleSpacing;
let availableW = taskmanager.remainingSpacesForTaskManager - totalSpacing;
let maxW = availableW / visualModel.count;
return Math.min(targetW, Math.max(1, maxW));
}
implicitHeight: {
let targetH = useColumnLayout ? visualModel.cellWidth : taskmanager.implicitHeight;
if (!useColumnLayout || visualModel.count <= 0) return targetH;

let totalSpacing = Math.max(0, visualModel.count - 1) * taskmanager.appTitleSpacing;
let availableH = taskmanager.remainingSpacesForTaskManager - totalSpacing;
let maxH = availableH / visualModel.count;
return Math.min(targetH, Math.max(1, maxH));
}
implicitWidth: useColumnLayout ? taskmanager.implicitWidth : appItem.implicitWidth
implicitHeight: useColumnLayout ? visualModel.cellWidth : taskmanager.implicitHeight

property int visualIndex: DelegateModel.itemsIndex
property var modelIndex: visualModel.modelIndex(index)
Expand Down
Loading