fix(taskManager): 规避x下,预览图大小变化会引起预览图错误隐藏的问题

This commit is contained in:
qiqi49 2024-08-13 17:18:43 +08:00 committed by iaom
parent d71d6a4ee2
commit ebaf6e2487
2 changed files with 20 additions and 13 deletions

View File

@ -196,7 +196,7 @@ DropArea {
function activeWinId(winId) {
//
taskItemListRoot.requestThumbnailView(false, null, null);
taskItemListRoot.requestThumbnailView(false, null, mouseArea);
if (UkuiTaskManager.TaskManager.windowIsActivated(winId)) {
UkuiTaskManager.TaskManager.execSpecifiedAction(UkuiTaskManager.Action.Minimize, winId);
} else {
@ -213,7 +213,7 @@ DropArea {
}
drag.target: mouseArea
drag.onActiveChanged: {
taskItemListRoot.requestThumbnailView(false, null, null);
taskItemListRoot.requestThumbnailView(false, null, mouseArea);
if (drag.active) {
taskItemListRoot.isDragging = true;
taskItemRoot.startDrag();
@ -228,6 +228,8 @@ DropArea {
taskItemProxyModel.openMenu(false, model.Actions, taskItemView);
taskManagerActived = true;
isTaskMenuShow = true;
taskItemListRoot.requestThumbnailView(false, null, mouseArea);
} else {
if (CurrentWinIdList.length === 0) {
taskItemDelegateModel.model.launch(taskItemDelegateModel.model.index(model.index, 0));
@ -272,7 +274,7 @@ DropArea {
}
onExited: {
taskItemListRoot.requestThumbnailView(false, taskItemData, null);
taskItemListRoot.requestThumbnailView(false, taskItemData, mouseArea);
}
TaskItemData {

View File

@ -64,7 +64,7 @@ TaskManager {
PauseAnimation { duration: 400 }
ScriptAction {
script: {
if (!thumbnailView.visible) {
if (!thumbnailView.visible && !isTaskMenuShow) {
thumbnailView.updatePosition();
thumbnailView.show();
updateBlurRegionTimer.restart();
@ -79,7 +79,7 @@ TaskManager {
PauseAnimation { duration: 400 }
ScriptAction {
script: {
if (thumbnailView.visible) {
if (thumbnailView.visible && (!taskItemData.mouse.containsMouse || isTaskMenuShow)) {
UkuiTaskManager.TaskManager.activateWindowView([]);
thumbnailView.hide();
}
@ -91,23 +91,21 @@ TaskManager {
Timer {
id: changedThumbnailData
property var dataToBeChanged
property Item mouse
interval: 400
onTriggered: {
if (mouse.containsMouse) {
viewContent.thumbnailData = dataToBeChanged;
if (taskItemData.mouse.containsMouse) {
viewContent.thumbnailData = taskItemData.dataToBeChanged;
}
}
}
onRequestThumbnailView: (show, data, mouse) => {
if (show && !isTaskMenuShow) {
taskItemData.mouse = mouse;
if (show) {
state = "aboutToShowThumbnail";
if (thumbnailView.visible) {
// timer
changedThumbnailData.dataToBeChanged = data;
changedThumbnailData.mouse = mouse;
changedThumbnailData.start();
taskItemData.dataToBeChanged = data;
changedThumbnailData.restart();
} else {
viewContent.thumbnailData = data;
}
@ -117,6 +115,13 @@ TaskManager {
}
}
QtObject {
id: taskItemData
// taskItemcontainsMouse / Xbug
property Item mouse
property var dataToBeChanged
}
Items.Dialog {
id: thumbnailView
mainItem: viewContent