MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / createSetting

Method createSetting

src/main/views/manager.ts:353–381  ·  view source on GitHub ↗
(tab?: string | null)

Source from the content-addressed store, hash-verified

351 }
352
353 createSetting(tab?: string | null) {
354 const width = 550;
355 const height = 680;
356 const {
357 x: xBound,
358 y: yBound,
359 width: screenWidth,
360 height: screenHeight,
361 } = this.getDisplay().bounds;
362
363 const t = store.getters.locale;
364 const cfg = {
365 x: xBound + (screenWidth - width) / 2,
366 y: yBound + (screenHeight - height) / 2,
367 width: width,
368 height: height,
369 maximizable: false,
370 minimizable: false,
371 title: t["settings"],
372 parent: this.mainWindow,
373 frame: false,
374 };
375 // TODO 这里要保存用户当前的窗口参数
376 // const previous_cfg = config.get<LayoutConfig>("settings");
377 // cfg["width"] = previous_cfg["width"];
378 // cfg["height"] = previous_cfg["height"];
379 const queryString = tab ? "?" + qs.stringify({ tab }) : "";
380 return this.createWindow("settings", cfg, false, queryString);
381 }
382}

Callers 2

showSettingsMethod · 0.95
createMethod · 0.95

Calls 2

getDisplayMethod · 0.95
createWindowMethod · 0.95

Tested by

no test coverage detected