Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: double click to activate the detail window #263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions src/deepin-album.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@
<file>qml/Control/MonthImage.qml</file>
<file>qml/Control/Animation/SwitchViewAnimation.qml</file>
<file>qml/Control/Animation/FadeInoutAnimation.qml</file>
<file>qml/Control/ListView/ThumbnailListShare.js</file>
</qresource>
</RCC>
7 changes: 6 additions & 1 deletion src/qml/Control/ListView/ThumbnailListDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.deepin.dtk 1.0
import Qt5Compat.GraphicalEffects

import org.deepin.album 1.0 as Album

import "ThumbnailListShare.js" as Share
import "../"
import "../../"
import "./"
Expand Down Expand Up @@ -380,6 +380,11 @@ Item {
}

mouse.accepted = true
Share.isFaverDoubleClicked = false
}
onDoubleClicked: (mouse)=> {
mouse.accepted = true
Share.isFaverDoubleClicked = true
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/qml/Control/ListView/ThumbnailListShare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

.pragma library

var isFaverDoubleClicked = false
7 changes: 5 additions & 2 deletions src/qml/Control/ListView/ThumbnailListViewAlbum.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import "../../PreviewImageViewer"
import "../../PreviewImageViewer/Utils"

import "ThumbnailListViewTools.js" as ThumbnailTools

import "ThumbnailListShare.js" as Share
FocusScope {
id : main

Expand Down Expand Up @@ -322,12 +322,15 @@ FocusScope {
// 单击模式点击/双击模式双击打开图片
if (Qt.styleHints.singleClickActivation || bDbClicked || mouse.source === Qt.MouseEventSynthesizedByQt) {
var c = clickedItem.mapToItem(mainStack, 0, 0)
ThumbnailTools.executeViewImage(c.x, c.y, clickedItem.width, clickedItem.height)
console.log(Share.isFaverDoubleClicked)
if (!Share.isFaverDoubleClicked)
ThumbnailTools.executeViewImage(c.x, c.y, clickedItem.width, clickedItem.height)
}
else {
bDbClicked = true;
dbClickTimer.interval = Qt.styleHints.mouseDoubleClickInterval;
dbClickTimer.start();
Share.isFaverDoubleClicked = false;
}
}

Expand Down
Loading