fix(taskManager): 规避x下,预览图大小变化会引起预览图错误隐藏的问题
This commit is contained in:
parent
d71d6a4ee2
commit
ebaf6e2487
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
// 当前预览图对应的taskItem,通过containsMouse判断是否数据更新 / 解决X下预览图尺寸变化会触发隐藏的bug
|
||||
property Item mouse
|
||||
property var dataToBeChanged
|
||||
}
|
||||
|
||||
Items.Dialog {
|
||||
id: thumbnailView
|
||||
mainItem: viewContent
|
||||
|
|
Loading…
Reference in New Issue