@@ -29,9 +29,10 @@ const config = new Store({
29
29
"record-ai-games" : false ,
30
30
"hotkey" : "Control+Shift+D" ,
31
31
"dark-mode" : true ,
32
- "exit-on-close" : false ,
32
+ "exit-on-close" : true ,
33
33
"margin" : 3 ,
34
- "swap-increment" : false
34
+ "swap-increment" : false ,
35
+ "preview-width" : 340
35
36
}
36
37
} ) ;
37
38
const data = new Store ( {
@@ -171,7 +172,7 @@ function createWindow () {
171
172
nodeIntegration :true
172
173
}
173
174
} )
174
- mainWindow . webContents . openDevTools ( )
175
+ // mainWindow.webContents.openDevTools()
175
176
mainWindow . loadFile ( "main.html" ) ;
176
177
177
178
mainWindow . on ( 'close' , function ( event ) {
@@ -238,8 +239,8 @@ function createWindow () {
238
239
} ) ;
239
240
240
241
fullCardWindow = new BrowserWindow ( {
241
- width :340 ,
242
- height :512 ,
242
+ width :config . get ( "preview-width" ) ,
243
+ height :parseInt ( config . get ( "preview-width" ) * 512 / 340 ) ,
243
244
maximizable :false ,
244
245
transparent :true ,
245
246
skipTaskbar :true ,
@@ -388,6 +389,7 @@ function createWindow () {
388
389
let windowPosition ;
389
390
let windowSize ;
390
391
let windowY ;
392
+ let fullSize = fullCardWindow . getSize ( ) ;
391
393
392
394
switch ( window ) {
393
395
case "tracker" :
@@ -409,18 +411,18 @@ function createWindow () {
409
411
break ;
410
412
}
411
413
412
- if ( windowPosition [ 1 ] - 256 + y < 0 ) {
414
+ if ( windowPosition [ 1 ] - ( fullSize [ 1 ] / 2 ) + y < 0 ) {
413
415
windowY = 0 ;
414
416
}
415
- else if ( windowPosition [ 1 ] + 256 + y > screen . getPrimaryDisplay ( ) . workAreaSize . height ) {
416
- windowY = screen . getPrimaryDisplay ( ) . workAreaSize . height - 512 ;
417
+ else if ( windowPosition [ 1 ] + ( fullSize [ 1 ] / 2 ) + y > screen . getPrimaryDisplay ( ) . workAreaSize . height ) {
418
+ windowY = parseInt ( screen . getPrimaryDisplay ( ) . workAreaSize . height - fullSize [ 1 ] ) ;
417
419
}
418
420
else {
419
- windowY = windowPosition [ 1 ] - 256 + y ;
421
+ windowY = parseInt ( windowPosition [ 1 ] - ( fullSize [ 1 ] / 2 ) + y ) ;
420
422
}
421
423
422
424
if ( windowPosition [ 0 ] > screen . getPrimaryDisplay ( ) . workAreaSize . width / 2 || window === "main" ) { // config
423
- fullCardWindow . setPosition ( windowPosition [ 0 ] - 340 , windowY ) ;
425
+ fullCardWindow . setPosition ( windowPosition [ 0 ] - fullSize [ 0 ] , windowY ) ;
424
426
}
425
427
else {
426
428
fullCardWindow . setPosition ( windowPosition [ 0 ] + windowSize [ 0 ] , windowY ) ;
@@ -477,6 +479,9 @@ function createWindow () {
477
479
if ( config . get ( "opponent-deck-disabled" ) ) {
478
480
oppDeckWindow . hide ( ) ;
479
481
}
482
+
483
+ fullCardWindow . setSize ( config . get ( "preview-width" ) , parseInt ( config . get ( "preview-width" ) * 512 / 340 ) ) ;
484
+
480
485
} ) ;
481
486
482
487
registerHotkeys ( ) ;
0 commit comments