Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: 启动时窗口大小 可配置化 #347

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
personalUrl: ''
},
startShowWindow: true, // 启动时是否打开窗口:true=打开窗口, false=隐藏窗口
windowSize: { width: 900, height: 750 }, // 启动时,窗口的尺寸
theme: 'dark', // 主题:light=亮色, dark=暗色
autoChecked: true, // 是否自动检查更新
skipPreRelease: true, // 是否忽略预发布版本
Expand Down
6 changes: 3 additions & 3 deletions packages/gui/src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ function changeAppConfig (config) {

function createWindow (startHideWindow) {
// Create the browser window.

const windowSize = DevSidecar.api.config.get().app.windowSize || {}
win = new BrowserWindow({
width: 900,
height: 750,
width: windowSize.width || 900,
height: windowSize.height || 750,
title: 'DevSidecar',
webPreferences: {
enableRemoteModule: true,
Expand Down
4 changes: 4 additions & 0 deletions packages/gui/src/view/pages/setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
启动软件时,是否打开窗口。提示:如果设置为隐藏窗口,可点击系统托盘小图标打开窗口。
</div>
</a-form-item>
<a-form-item label="启动时窗口大小" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input-number v-model="config.app.windowSize.width" :min="600" :max="2400"/>&nbsp;*
<a-input-number v-model="config.app.windowSize.height" :min="500" :max="2000"/>
</a-form-item>
<hr/>
<a-form-item label="自动检查更新" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-radio-group v-model="config.app.autoChecked" default-value="light" button-style="solid">
Expand Down