File tree Expand file tree Collapse file tree 4 files changed +596
-514
lines changed
Expand file tree Collapse file tree 4 files changed +596
-514
lines changed Original file line number Diff line number Diff line change 77 "env",
88 {
99 "targets": {
10- "electron": "1.8.4 "
10+ "electron": "2.0.2 "
1111 }
1212 }
1313 ],
2626 "env",
2727 {
2828 "targets": {
29- "electron": "1.8.4 "
29+ "electron": "2.0.2 "
3030 }
3131 }
3232 ],
3939 }
4040 }
4141 }
42- }
42+ }
Original file line number Diff line number Diff line change 4040 " zip"
4141 ],
4242 "linux" : [
43+ " snap" ,
4344 " deb" ,
4445 " rpm"
4546 ]
8990 "dependencies" : {
9091 "babel-preset-es2016" : " ^6.24.1" ,
9192 "chokidar" : " ^2.0.0" ,
92- "electron" : " 1.8.4 " ,
93+ "electron" : " 2.0.2 " ,
9394 "electron-compile" : " ^6.4.2" ,
9495 "electron-log" : " ^2.2.14" ,
9596 "gitlab-time-tracker" : " ^1.7.19" ,
101102 "babel-plugin-transform-async-to-generator" : " ^6.24.1" ,
102103 "babel-preset-env" : " ^1.6.1" ,
103104 "babel-preset-react" : " ^6.24.1" ,
104- "electron-forge" : " ^4.2 .0" ,
105+ "electron-forge" : " ^5.0 .0" ,
105106 "electron-prebuilt-compile" : " 1.7.11" ,
106107 "eslint" : " ^3" ,
107108 "eslint-config-airbnb" : " ^15" ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ log.transports.file.appName = 'gtt-taskbar';
1717let gtt = new events . EventEmitter ( ) ,
1818 trayIcon = null ,
1919 trayWindow = null ,
20+ trayPos = null ,
2021 contextMenu = null ,
2122 settingsWindow = null ,
2223 aboutWindow = null ,
@@ -49,7 +50,7 @@ app.on('window-all-closed', () => {
4950app . disableHardwareAcceleration ( ) ;
5051
5152// Single instance
52- if ( app . makeSingleInstance ( ( ) => {
53+ if ( app . makeSingleInstance ( ( ) => {
5354 if ( trayWindow ) {
5455 trayWindow . show ( ) ;
5556 trayWindow . focus ( ) ;
@@ -221,9 +222,12 @@ gtt.setTray = () => {
221222
222223 if ( gtt . _platform == 'linux' ) {
223224 let contextMenu = Menu . buildFromTemplate ( [
224- { label : 'Open GTT' , click : gtt . toggleTrayWindow } ,
225+ {
226+ label : 'Open GTT' , click : gtt . toggleTrayWindow
227+ } ,
225228 { label : 'Quit' , click : app . quit }
226229 ] ) ;
230+
227231 trayIcon . setContextMenu ( contextMenu ) ;
228232 } else {
229233
@@ -248,8 +252,7 @@ gtt.toggleTrayWindow = bounds => {
248252 y = bounds . y - 250 ;
249253 }
250254 } else {
251- let { width} = electron . screen . getPrimaryDisplay ( ) . workAreaSize ;
252- x = ( width / 2 ) - ( trayWindowBounds . width / 2 ) ;
255+ x = electron . screen . getCursorScreenPoint ( ) . x - ( trayWindowBounds . width / 2 ) ;
253256 y = 30 ;
254257 }
255258
You can’t perform that action at this time.
0 commit comments