Feature: Support double click in drag areas

This commit is contained in:
Lea Anthony
2022-04-09 10:27:54 +10:00
parent 65a97a668e
commit f08176079c
5 changed files with 25 additions and 15 deletions
+4 -4
View File
@@ -45,7 +45,8 @@ window.wails = {
disableWailsDefaultContextMenu: false,
enableResize: false,
defaultCursor: null,
borderThickness: 6
borderThickness: 6,
dbClickInterval: 100,
}
};
@@ -62,7 +63,6 @@ if (ENV === 0) {
var dragTimeOut;
var dragLastTime = 0;
var dbClickInterval = 100;
// Setup drag handler
// Based on code from: https://github.com/patr0nus/DeskGap
@@ -87,13 +87,13 @@ window.addEventListener('mousedown', (e) => {
break;
}
}
if (new Date().getTime() - dragLastTime < dbClickInterval) {
if (new Date().getTime() - dragLastTime < window.wails.flags.dbClickInterval) {
clearTimeout(dragTimeOut)
break;
}
dragTimeOut = setTimeout(function () {
window.WailsInvoke("drag");
}, dbClickInterval)
}, window.wails.flags.dbClickInterval)
dragLastTime = new Date().getTime();
e.preventDefault();
break;
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long