Skip to content

Commit

Permalink
Merge pull request #11 from zonayedpca/v0.10.0-beta
Browse files Browse the repository at this point in the history
V0.10.0 beta
  • Loading branch information
zonayedpca authored Sep 23, 2019
2 parents 6123ab7 + 25c7697 commit 91998e8
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 17 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: node_js
matrix:
include:
- os: linux
- os: osx
node_js:
- 8
Expand Down
26 changes: 26 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,29 @@ win:
# Config for the windows installer
nsis:
oneClick: false

# Linux configuration
linux:
icon: 'src/assets/img/icon256x256.png'
target:
- target: 'AppImage'
arch:
- x64
- ia32
- target: 'deb'
arch:
- x64
- ia32
- target: 'rpm'
arch:
- x64
- ia32
- target: 'zip'
arch:
- x64
- ia32
- target: 'tar.gz'
arch:
- x64
- ia32
publish: ['github']
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "devtop",
"version": "0.9.0-beta",
"version": "0.10.0-beta",
"description": "DevTop - Essential Tools for Developers",
"main": "app.js",
"author": {
Expand Down
39 changes: 23 additions & 16 deletions src/utils/getPosition.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,29 @@ module.exports = (tray, window) => {
const { x, y, height, width } = tray.getBounds();
const { height: winHeight, width: winWidth } = window.getBounds();
let setX, setY;
if(y < (SIZE_THRESHOLD + (winHeight / 2))) {
// top
setX = x - (winWidth/2 - (width/2));
setY = y + height;
} else if(y > SIZE_THRESHOLD && y > (display.height - SIZE_THRESHOLD)) {
// bottom
setX = x - (winWidth/2 - (width/2));
setY = y - winHeight;
} else if(x < (SIZE_THRESHOLD + winWidth)) {
// left
setX = x + width;
setY = y - (winHeight - height);
if (process.platform !== 'linux') {
if (y < SIZE_THRESHOLD + winHeight / 2) {
// top
setX = x - (winWidth / 2 - width / 2);
setY = y + height;
} else if (y > SIZE_THRESHOLD && y > display.height - SIZE_THRESHOLD) {
// bottom
setX = x - (winWidth / 2 - width / 2);
setY = y - winHeight;
} else if (x < SIZE_THRESHOLD + winWidth) {
// left
setX = x + width;
setY = y - (winHeight - height);
} else {
// right
setX = x - winWidth;
setY = y - (winHeight - height);
}
} else {
// right
setX = x - winWidth;
setY = y - (winHeight - height);
// for linux
setX = display.height + winWidth / 2;
setY = display.y;
}

return { setX, setY };
}
};

0 comments on commit 91998e8

Please sign in to comment.