| 318 | } |
| 319 | |
| 320 | createMain() { |
| 321 | let window_config = { |
| 322 | x: 535, |
| 323 | y: 186, |
| 324 | height: 600, |
| 325 | width: 1094, |
| 326 | show: false, |
| 327 | frame: false, |
| 328 | title: "CopyTranslator", |
| 329 | transparent: true, |
| 330 | }; |
| 331 | const previous_config = config.get<LayoutConfig>(config.get("layoutType")); |
| 332 | window_config = { ...window_config, ...previous_config }; |
| 333 | const window = this.createWindow("contrast", window_config, true); |
| 334 | window.on("blur", () => { |
| 335 | this.edgeHide(this.onEdge()); |
| 336 | }); |
| 337 | window.on("focus", () => { |
| 338 | this.edgeShow(); |
| 339 | }); |
| 340 | window.on("resize", () => { |
| 341 | this.saver.call(); |
| 342 | }); |
| 343 | window.on("move", () => { |
| 344 | this.saver.call(); |
| 345 | }); |
| 346 | return window; |
| 347 | } |
| 348 | |
| 349 | getDisplay() { |
| 350 | return screen.getDisplayNearestPoint(screen.getCursorScreenPoint()); |