mirror of
https://github.com/FranP-code/wintile.git
synced 2025-10-13 00:33:46 +00:00
Added side margins for mouse movement
This commit is contained in:
22
extension.js
22
extension.js
@@ -26,7 +26,7 @@ var _log = function(str) {
|
||||
let config = {
|
||||
cols: 2,
|
||||
useMaximize: true,
|
||||
close: 50,
|
||||
close: 75,
|
||||
debug: true
|
||||
}
|
||||
|
||||
@@ -665,6 +665,26 @@ function checkIfNearGrid(app) {
|
||||
showPreview(i, 1, grid_x, space.y+rowHeight, colWidth, rowHeight)
|
||||
close = true;
|
||||
break;
|
||||
} else if ((isClose(x, space.x) || x < space.x) && y > space.y && y < space.y+rowHeight) {
|
||||
// If we are close to the top left, show the top left grid item
|
||||
showPreview(0, 0, space.x, space.y, colWidth, rowHeight)
|
||||
close = true;
|
||||
break;
|
||||
} else if ((isClose(x, space.x) || x < space.x) && y > space.y+rowHeight) {
|
||||
// If we are close to the bottom left, show the bottom left grid item
|
||||
showPreview(0, 1, space.x, space.y+rowHeight, colWidth, rowHeight)
|
||||
close = true;
|
||||
break;
|
||||
} else if ((isClose(x, space.x+space.width) || x > space.x+space.width) && y > space.y && y < space.y+rowHeight) {
|
||||
// If we are close to the top right, show the top right grid item
|
||||
showPreview(config.cols, 0, space.x+space.width-colWidth, space.y, colWidth, rowHeight)
|
||||
close = true;
|
||||
break;
|
||||
} else if ((isClose(x, space.x+space.width) || x > space.x+space.width) && y > space.y+rowHeight) {
|
||||
// If we are close to the bottom right, show the bottom right grid item
|
||||
showPreview(config.cols, 1, space.x+space.width-colWidth, space.y+rowHeight, colWidth, rowHeight)
|
||||
close = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!close)
|
||||
|
||||
Reference in New Issue
Block a user