forked from openkylin/ukui-panel
fix(taskManager):解决初次加载图标重叠和icon报错问题
This commit is contained in:
parent
3de43b9127
commit
1113862c6d
|
@ -145,10 +145,4 @@ WidgetItem {
|
|||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
// init
|
||||
if (Widget.globalConfig.mergeIcons === undefined) {
|
||||
Widget.globalConfig.mergeIcons = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,13 +102,14 @@ DropArea {
|
|||
property bool useSingleItem: taskItemView.isMergeStatus || (CurrentWinIdList ? CurrentWinIdList.length < 1 : true)
|
||||
//非合并状态下激活预览图时 对应的winId
|
||||
property var singleWinId: []
|
||||
property bool iconNeedsUpdate: true
|
||||
|
||||
width: taskItemView.isHorizontal ? taskItemLoader.width : taskItemView.width
|
||||
height: taskItemView.isHorizontal ? taskItemView.height : taskItemLoader.height
|
||||
visible: DelegateModel.inItems || !isDragStatus
|
||||
|
||||
onIconChanged: {
|
||||
generateDragImage();
|
||||
iconNeedsUpdate = true;
|
||||
}
|
||||
|
||||
function generateDragImage() {
|
||||
|
@ -195,7 +196,12 @@ DropArea {
|
|||
}
|
||||
|
||||
// 为拖拽截图
|
||||
// onPressed: parent.generateDragImage();
|
||||
onPressed: {
|
||||
if (iconNeedsUpdate) {
|
||||
parent.generateDragImage();
|
||||
iconNeedsUpdate = false;
|
||||
}
|
||||
}
|
||||
drag.target: mouseArea
|
||||
drag.onActiveChanged: {
|
||||
taskItemListRoot.requestThumbnailView(false, null);
|
||||
|
@ -400,7 +406,11 @@ DropArea {
|
|||
// contentWidth: childrenRect.width
|
||||
// width: childrenRect.width
|
||||
// height: parent.height
|
||||
property bool isMergeStatus: (Widget.globalConfig.mergeIcons === 0)
|
||||
|
||||
property bool isMergeStatus: {
|
||||
var status = Widget.globalConfig.mergeIcons;
|
||||
return (status === undefined) || (status === 0) ;
|
||||
}
|
||||
property bool isHorizontal: orientation === ListView.Horizontal
|
||||
property real taskItemSize: isHorizontal ? taskItemView.height : taskItemView.width
|
||||
clip: true
|
||||
|
@ -426,6 +436,19 @@ DropArea {
|
|||
updateIconGeometryTimer.restart();
|
||||
}
|
||||
|
||||
function updateIconState() {
|
||||
for (let i = 0; i < taskItemDelegateModel.count; ++i) {
|
||||
taskItemView.itemAtIndex(i).iconNeedsUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
Platform.Theme.iconThemeChanged.connect(updateIconState);
|
||||
if (Widget.globalConfig.mergeIcons === undefined) {
|
||||
Widget.globalConfig.mergeIcons = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: updateIconGeometryTimer
|
||||
interval: 500
|
||||
|
|
Loading…
Reference in New Issue