Skip to content

Commit

Permalink
Merge pull request #260 from 1129921824/master
Browse files Browse the repository at this point in the history
拼写优化及窗口高度设置
  • Loading branch information
muwoo authored Oct 13, 2023
2 parents 9eb59a9 + 3a2f44a commit 7db7b9e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/common/constans/common.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export const WINDOW_WIDTH = 688;
export const WINDOW_HEIGHT = 60;

export const WINDOW_MIN_HEIGHT = 60;
3 changes: 1 addition & 2 deletions src/core/app-search/win.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ function fileDisplay(filePath) {
}
if (
!appDetail.target ||
appDetail.target.toLowerCase().indexOf('unin') >= 0 ||
appDetail.args
appDetail.target.toLowerCase().indexOf('unin') >= 0
)
return;

Expand Down
3 changes: 3 additions & 0 deletions src/main/browsers/detach.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -17,6 +18,7 @@ export default () => {
const createWindow = async (pluginInfo, viewInfo, view) => {
win = new BrowserWindow({
height: viewInfo.height,
minHeight: WINDOW_MIN_HEIGHT,
width: viewInfo.width,
autoHideMenuBar: true,
titleBarStyle: 'hidden',
Expand All @@ -36,6 +38,7 @@ export default () => {
webviewTag: true,
devTools: true,
nodeIntegration: true,
spellcheck: false,
},
});
if (process.env.WEBPACK_DEV_SERVER_URL) {
Expand Down
7 changes: 5 additions & 2 deletions src/main/browsers/guide.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -39,15 +40,17 @@ export default () => {
enableLargerThanScreen: true,
x,
y,
width: 800,
height: 600,
width: WINDOW_WIDTH,
height: WINDOW_HEIGHT,
minHeight: WINDOW_MIN_HEIGHT,
webPreferences: {
webSecurity: false,
backgroundThrottling: false,
contextIsolation: false,
webviewTag: true,
devTools: true,
nodeIntegration: true,
spellcheck: false,
},
});
if (process.env.WEBPACK_DEV_SERVER_URL) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/browsers/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -19,6 +19,7 @@ export default () => {
const createWindow = async () => {
win = new BrowserWindow({
height: WINDOW_HEIGHT,
minHeight: WINDOW_MIN_HEIGHT,
useContentSize: true,
resizable: true,
width: WINDOW_WIDTH,
Expand All @@ -34,6 +35,7 @@ export default () => {
webviewTag: true,
nodeIntegration: true,
preload: path.join(__static, 'preload.js'),
spellcheck: false,
},
});
if (process.env.WEBPACK_DEV_SERVER_URL) {
Expand Down
1 change: 1 addition & 0 deletions src/main/browsers/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export default () => {
standard: 'system-ui',
serif: 'system-ui',
},
spellcheck: false,
},
});
window.setBrowserView(view);
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const emit = defineEmits([
'focus',
'clearSearchValue',
'readClipboardContent',
'clearClipbord',
]);
const keydownEvent = (e, key: string) => {
Expand Down

0 comments on commit 7db7b9e

Please sign in to comment.