From f47d273113deab47b7ee88691c3857a99439cebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92=E8=B5=AB=E8=90=9D?= Date: Fri, 24 Mar 2023 15:57:43 +0800 Subject: [PATCH] :sparkles: Feature: optimize UI, rewrite some css settings --- public/i18n/en.yml | 8 ++ public/i18n/zh-CN.yml | 8 ++ public/i18n/zh-TW.yml | 8 ++ src/main/apis/app/window/windowList.ts | 19 +++- src/renderer/layouts/Main.vue | 8 +- src/renderer/manage/pages/logIn.vue | 7 +- src/renderer/manage/pages/manageMain.vue | 4 +- src/renderer/pages/Gallery.vue | 2 +- src/renderer/pages/PicGoSetting.vue | 104 +++++++++++++++++++++- src/renderer/pages/Plugin.vue | 3 +- src/renderer/pages/Upload.vue | 2 +- src/renderer/pages/UploaderConfigPage.vue | 2 +- src/renderer/pages/picbeds/index.vue | 3 + src/universal/types/i18n.d.ts | 8 ++ 14 files changed, 166 insertions(+), 20 deletions(-) diff --git a/public/i18n/en.yml b/public/i18n/en.yml index d9625778..e794d3ae 100644 --- a/public/i18n/en.yml +++ b/public/i18n/en.yml @@ -166,6 +166,14 @@ SETTINGS_CHOOSE_LANGUAGE: Choose Language UPLOADER_CONFIG_NAME: Configuration Name UPLOADER_CONFIG_PLACEHOLDER: Please Enter Configuration Name SELECTED_SETTING_HINT: Selected +SETTINGS_MAIN_WINDOW_SIZE: Default Main Window Size +SETTINGS_MAIN_WINDOW_WIDTH: Default Main Window Width +SETTINGS_MAIN_WINDOW_WIDTH_HINT: 'Default: 1200' +SETTINGS_MAIN_WINDOW_WIDTH_RULE: Window Height must be greater than 100 +SETTINGS_MAIN_WINDOW_HEIGHT: Default Main Window Height +SETTINGS_MAIN_WINDOW_HEIGHT_HINT: 'Default: 800' +SETTINGS_MAIN_WINDOW_HEIGHT_RULE: Window Height must be greater than 100 +SETTINGS_RAW_PICGO_SIZE: Raw PicGo Size SETTINGS_CUSTOM_MINI_ICON_PATH: Custom Mini Window Icon Path SETTINGS_CUSTOM_MINI_ICON: Custom Mini Window Icon SETTINGS_COMPRESS_AND_WATERMARK: Compress and Watermark diff --git a/public/i18n/zh-CN.yml b/public/i18n/zh-CN.yml index 97888bf3..a953a6ad 100644 --- a/public/i18n/zh-CN.yml +++ b/public/i18n/zh-CN.yml @@ -167,6 +167,14 @@ BUILTIN_CLIPBOARD_TIPS: 使用内置剪贴板函数而不是调用脚本获取 UPLOADER_CONFIG_NAME: 图床配置名 UPLOADER_CONFIG_PLACEHOLDER: 请输入配置名称 SELECTED_SETTING_HINT: 已选中 +SETTINGS_MAIN_WINDOW_SIZE: 默认主窗口大小(需重启) +SETTINGS_MAIN_WINDOW_SIZE_WIDTH: 默认主窗口宽度 +SETTINGS_MAIN_WINDOW_WIDTH_HINT: '默认宽度: 1200' +SETTINGS_MAIN_WINDOW_WIDTH_RULE: 窗口宽度必须大于100 +SETTINGS_MAIN_WINDOW_SIZE_HEIGHT: 默认主窗口高度 +SETTINGS_MAIN_WINDOW_HEIGHT_HINT: '默认高度: 800' +SETTINGS_MAIN_WINDOW_HEIGHT_RULE: 窗口高度必须大于100 +SETTINGS_RAW_PICGO_SIZE: 原PicGo大小 SETTINGS_CUSTOM_MINI_ICON_PATH: 自定义Mini窗口图标路径 SETTINGS_CUSTOM_MINI_ICON: 是否自定义Mini窗口图标 SETTINGS_COMPRESS_AND_WATERMARK: 设置图片水印和压缩-格式转换等参数 diff --git a/public/i18n/zh-TW.yml b/public/i18n/zh-TW.yml index 01d6921a..e4be84e0 100644 --- a/public/i18n/zh-TW.yml +++ b/public/i18n/zh-TW.yml @@ -167,6 +167,14 @@ BUILTIN_CLIPBOARD_TIPS: 使用內建剪貼簿函數而不是調用腳本取得 UPLOADER_CONFIG_NAME: 圖床配置名 UPLOADER_CONFIG_PLACEHOLDER: 請輸入配置名稱 SELECTED_SETTING_HINT: 已選中 +SETTINGS_MAIN_WINDOW_SIZE: 默認主視窗大小 +SETTINGS_MAIN_WINDOW_SIZE_WIDTH: 默認主視窗寬度 +SETTINGS_MAIN_WINDOW_WIDTH_HINT: '默認: 1200' +SETTINGS_MAIN_WINDOW_WIDTH_RULE: 窗口寬度必須大於100 +SETTINGS_MAIN_WINDOW_SIZE_HEIGHT: 默認主視窗高度 +SETTINGS_MAIN_WINDOW_HEIGHT_HINT: '默認: 800' +SETTINGS_MAIN_WINDOW_HEIGHT_RULE: 窗口高度必須大於100 +SETTINGS_RAW_PICGO_SIZE: 原PicGo大小 SETTINGS_CUSTOM_MINI_ICON_PATH: 自訂Mini視窗圖示路徑 SETTINGS_CUSTOM_MINI_ICON: 自訂Mini視窗圖示 SETTINGS_COMPRESS_AND_WATERMARK: 設置圖片浮水印和壓縮-格式轉換等參數 diff --git a/src/main/apis/app/window/windowList.ts b/src/main/apis/app/window/windowList.ts index 3ba74ddf..5f33ea63 100644 --- a/src/main/apis/app/window/windowList.ts +++ b/src/main/apis/app/window/windowList.ts @@ -11,6 +11,7 @@ import db from '~/main/apis/core/datastore' import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '#/events/constants' import { app } from 'electron' import { remoteNoticeHandler } from '../remoteNotice' +import picgo from '~/main/apis/core/picgo' const windowList = new Map() @@ -18,6 +19,20 @@ const handleWindowParams = (windowURL: string) => { return windowURL } +const getDefaultWindowSizes = (): { width: number, height: number } => { + const mainWindowWidth = picgo.getConfig('settings.mainWindowWidth') + const mainWindowHeight = picgo.getConfig('settings.mainWindowHeight') + console.log('mainWindowWidth', mainWindowWidth) + console.log('mainWindowHeight', mainWindowHeight) + return { + width: mainWindowWidth || 1200, + height: mainWindowHeight || 800 + } +} + +const defaultWindowWidth = getDefaultWindowSizes().width +const defaultWindowHeight = getDefaultWindowSizes().height + windowList.set(IWindowList.TRAY_WINDOW, { isValid: process.platform !== 'linux', multiple: false, @@ -53,8 +68,8 @@ windowList.set(IWindowList.SETTING_WINDOW, { multiple: false, options () { const options: IBrowserWindowOptions = { - height: 800, - width: 1200, + height: defaultWindowHeight, + width: defaultWindowWidth, show: false, frame: true, center: true, diff --git a/src/renderer/layouts/Main.vue b/src/renderer/layouts/Main.vue index a103d092..99eb84a4 100644 --- a/src/renderer/layouts/Main.vue +++ b/src/renderer/layouts/Main.vue @@ -460,7 +460,7 @@ $darwinBg = transparentify(#172426, #000, 0.7) height calc(100vh - 22px) overflow-x hidden overflow-y auto - width 170px + width 162px .info-window cursor pointer position fixed @@ -474,7 +474,7 @@ $darwinBg = transparentify(#172426, #000, 0.7) .el-menu border-right none background transparent - width 170px + width 162px &-item color #eee position relative @@ -487,7 +487,7 @@ $darwinBg = transparentify(#172426, #000, 0.7) &:before content '' position absolute - width 3px + width 1px height 20px right 0 top 18px @@ -520,7 +520,7 @@ $darwinBg = transparentify(#172426, #000, 0.7) input text-align center *::-webkit-scrollbar - width 8px + width 2px height 8px *::-webkit-scrollbar-thumb border-radius 4px diff --git a/src/renderer/manage/pages/logIn.vue b/src/renderer/manage/pages/logIn.vue index bb5bf774..88252470 100644 --- a/src/renderer/manage/pages/logIn.vue +++ b/src/renderer/manage/pages/logIn.vue @@ -757,11 +757,10 @@ onMounted(async () => {