mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-28 08:22:48 +08:00
窗体宽高使用变量,设置最小高度
This commit is contained in:
parent
437419aca3
commit
3a2f44a448
@ -1,2 +1,4 @@
|
||||
export const WINDOW_WIDTH = 688;
|
||||
export const WINDOW_HEIGHT = 60;
|
||||
|
||||
export const WINDOW_MIN_HEIGHT = 60;
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { BrowserWindow, ipcMain, nativeTheme } from 'electron';
|
||||
import localConfig from '../common/initLocalConfig';
|
||||
import path from 'path';
|
||||
import { WINDOW_MIN_HEIGHT } from '@/common/constans/common';
|
||||
export default () => {
|
||||
let win: any;
|
||||
|
||||
@ -17,7 +18,7 @@ export default () => {
|
||||
const createWindow = async (pluginInfo, viewInfo, view) => {
|
||||
win = new BrowserWindow({
|
||||
height: viewInfo.height,
|
||||
minHeight: 60,
|
||||
minHeight: WINDOW_MIN_HEIGHT,
|
||||
width: viewInfo.width,
|
||||
autoHideMenuBar: true,
|
||||
titleBarStyle: 'hidden',
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { BrowserWindow, ipcMain, nativeTheme, screen } from 'electron';
|
||||
import path from 'path';
|
||||
import { WINDOW_HEIGHT, WINDOW_MIN_HEIGHT, WINDOW_WIDTH } from '@/common/constans/common';
|
||||
|
||||
const getWindowPos = (width, height) => {
|
||||
const screenPoint = screen.getCursorScreenPoint();
|
||||
@ -39,9 +40,9 @@ export default () => {
|
||||
enableLargerThanScreen: true,
|
||||
x,
|
||||
y,
|
||||
width: 800,
|
||||
height: 600,
|
||||
minHeight: 60,
|
||||
width: WINDOW_WIDTH,
|
||||
height: WINDOW_HEIGHT,
|
||||
minHeight: WINDOW_MIN_HEIGHT,
|
||||
webPreferences: {
|
||||
webSecurity: false,
|
||||
backgroundThrottling: false,
|
||||
|
@ -3,7 +3,7 @@ import path from 'path';
|
||||
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib';
|
||||
// import versonHandler from '../common/versionHandler';
|
||||
import localConfig from '@/main/common/initLocalConfig';
|
||||
import { WINDOW_HEIGHT, WINDOW_WIDTH } from '@/common/constans/common';
|
||||
import { WINDOW_HEIGHT, WINDOW_MIN_HEIGHT, WINDOW_WIDTH } from '@/common/constans/common';
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require('@electron/remote/main').initialize();
|
||||
|
||||
@ -19,7 +19,7 @@ export default () => {
|
||||
const createWindow = async () => {
|
||||
win = new BrowserWindow({
|
||||
height: WINDOW_HEIGHT,
|
||||
minHeight: 60,
|
||||
minHeight: WINDOW_MIN_HEIGHT,
|
||||
useContentSize: true,
|
||||
resizable: true,
|
||||
width: WINDOW_WIDTH,
|
||||
|
Loading…
x
Reference in New Issue
Block a user