Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Commit e058473

Browse files
authored
Merge pull request #185 from jonathontoon/develop
Develop
2 parents 315c1c6 + 9e64add commit e058473

File tree

2 files changed

+14
-30
lines changed

2 files changed

+14
-30
lines changed

app/MenuBarManager.js

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -192,39 +192,21 @@ class MenuBarManager {
192192

193193
if (process.platform === 'win32') {
194194
// Vertical or Horizontal Taskbar
195-
196-
// Vertical Taskbar, small icon mode isn't applicable
197-
if (trayBounds.height === 32 || trayBounds.height === 33) {
198-
if (trayBounds.x <= halfScreenWidth && trayBounds.y >= halfScreenHeight) {
199-
// Vertical Left Bottom
200-
201-
trayPosition = 'trayBottomLeft';
202-
windowPosition = this._windowPositioner.calculate(trayPosition, trayBounds);
203-
positionToSet = { x: windowPosition.x + 78, y: windowPosition.y - 10, };
204-
} else if (trayBounds.x >= halfScreenWidth && trayBounds.y >= halfScreenHeight) {
205-
// Vertical Right Bottom
206-
207-
trayPosition = 'trayBottomRight';
195+
console.log(trayBounds, halfScreenWidth, halfScreenHeight, trayBounds.x >= halfScreenWidth, (trayBounds.y >= 30 || trayBounds.y <= 110));
196+
197+
if ((trayBounds.x + trayBounds.width) <= halfScreenWidth) {
198+
trayPosition = 'trayBottomLeft';
199+
windowPosition = this._windowPositioner.calculate(trayPosition, trayBounds);
200+
positionToSet = { x: windowPosition.x + 78, y: windowPosition.y - 10, };
201+
} else if ((trayBounds.x + trayBounds.width) >= halfScreenWidth) {
202+
if ((trayBounds.y + trayBounds.height) <= halfScreenHeight) {
203+
trayPosition = 'trayCenter';
208204
windowPosition = this._windowPositioner.calculate(trayPosition, trayBounds);
209-
positionToSet = { x: windowPosition.x - 8, y: windowPosition.y - 10, };
210-
}
211-
212-
// Horizontal Taskbar
213-
// Supporting small or regular sized icons
214-
} else if (trayBounds.height === 30 || trayBounds.height === 31 || trayBounds.height === 40) {
215-
// Is bottom or top
216-
if (trayBounds.x >= halfScreenWidth && trayBounds.y >= halfScreenHeight) {
217-
// Horizontal Bottom Left
218-
205+
positionToSet = { x: windowPosition.x, y: windowPosition.y + 8, };
206+
} else if ((trayBounds.y + trayBounds.height) >= halfScreenHeight) {
219207
trayPosition = 'trayBottomCenter';
220208
windowPosition = this._windowPositioner.calculate(trayPosition, trayBounds);
221209
positionToSet = { x: windowPosition.x, y: windowPosition.y - 6, };
222-
} else if (trayBounds.x >= halfScreenWidth && trayBounds.y === 0) {
223-
// Horizontal Top Left
224-
225-
trayPosition = 'trayCenter';
226-
windowPosition = this._windowPositioner.calculate(trayPosition, trayBounds);
227-
positionToSet = { x: windowPosition.x, y: windowPosition.y + 8, };
228210
}
229211
}
230212

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@
9898
],
9999
"homepage": "https://github.com/jonathontoon/tweet-tray#readme",
100100
"jest": {
101+
"verbose": true,
102+
"testURL": "http://localhost/",
101103
"moduleNameMapper": {
102104
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/fileMock.js",
103105
"\\.(css)$": "identity-obj-proxy"
@@ -211,4 +213,4 @@
211213
"npm": ">=4.x",
212214
"yarn": ">=0.21.3"
213215
}
214-
}
216+
}

0 commit comments

Comments
 (0)