mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Feature: Support double click in drag areas
This commit is contained in:
@@ -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
Reference in New Issue
Block a user