diff --git a/feature/src/assets/delete.png b/feature/src/assets/delete.png new file mode 100644 index 0000000..122b5de Binary files /dev/null and b/feature/src/assets/delete.png differ diff --git a/feature/src/main.ts b/feature/src/main.ts index 7713514..30c7015 100644 --- a/feature/src/main.ts +++ b/feature/src/main.ts @@ -33,6 +33,12 @@ import localConfig from './confOp'; const config: any = localConfig.getConfig(); +// 暗夜模式 +if (config.perf.common.darkMode) { + document.body.classList.add('dark'); + window.rubick.theme = 'dark'; +} + ConfigProvider.config({ theme: config.perf.custom || {}, }); diff --git a/package.json b/package.json index 3a71fc8..496a1cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rubick", - "version": "4.1.4", + "version": "4.1.5", "author": "muwoo <2424880409@qq.com>", "private": true, "scripts": { @@ -30,7 +30,7 @@ "fix-path": "^3.0.0", "get-mac-apps": "^1.0.2", "got": "^11.8.3", - "lodash.throttle": "^4.1.1", + "lodash.debounce": "^4.0.8", "memorystream": "^0.3.1", "node-key-sender": "^1.0.11", "npm": "6.14.7", diff --git a/public/icons/delete@2x.png b/public/icons/delete@2x.png new file mode 100644 index 0000000..122b5de Binary files /dev/null and b/public/icons/delete@2x.png differ diff --git a/public/icons/pin@2x.png b/public/icons/pin@2x.png new file mode 100644 index 0000000..3e1782f Binary files /dev/null and b/public/icons/pin@2x.png differ diff --git a/public/icons/unpin@2x.png b/public/icons/unpin@2x.png new file mode 100644 index 0000000..b234c8d Binary files /dev/null and b/public/icons/unpin@2x.png differ diff --git a/public/preload.js b/public/preload.js index 0f53e7a..0cf7acc 100644 --- a/public/preload.js +++ b/public/preload.js @@ -49,6 +49,10 @@ window.rubick = { showOpenDialog(options) { return ipcSendSync('showOpenDialog', options); }, + showSaveDialog(options) { + return ipcSendSync('showSaveDialog', options); + }, + setExpendHeight(height) { ipcSendSync('setExpendHeight', height); }, diff --git a/src/common/constans/renderer.ts b/src/common/constans/renderer.ts index 29f7059..81e56ed 100644 --- a/src/common/constans/renderer.ts +++ b/src/common/constans/renderer.ts @@ -4,5 +4,6 @@ import path from 'path'; const appPath = app.getPath('userData'); const PLUGIN_INSTALL_DIR = path.join(appPath, './rubick-plugins-new'); +const PLUGIN_HISTORY = 'rubick-local-start-app'; -export { PLUGIN_INSTALL_DIR }; +export { PLUGIN_INSTALL_DIR, PLUGIN_HISTORY }; diff --git a/src/common/utils/dragWindow.ts b/src/common/utils/dragWindow.ts index 64eebf3..0995bca 100644 --- a/src/common/utils/dragWindow.ts +++ b/src/common/utils/dragWindow.ts @@ -9,7 +9,8 @@ const useDrag = () => { let draggable = true; const onMouseDown = (e) => { - // if (commonConst.macOS()) return; + // 右击不移动 + if (e.button === 2) return; draggable = true; mouseX = e.clientX; mouseY = e.clientY; diff --git a/src/common/utils/getWindowHeight.ts b/src/common/utils/getWindowHeight.ts index f455a00..9e1a02b 100644 --- a/src/common/utils/getWindowHeight.ts +++ b/src/common/utils/getWindowHeight.ts @@ -1,6 +1,6 @@ -const WINDOW_MAX_HEIGHT = 600; +const WINDOW_MAX_HEIGHT = 620; const WINDOW_MIN_HEIGHT = 60; -const PRE_ITEM_HEIGHT = 60; +const PRE_ITEM_HEIGHT = 70; const HISTORY_HEIGHT = 70; export default (searchList: Array, historyList): number => { diff --git a/src/main/common/api.ts b/src/main/common/api.ts index ec36a2d..3fe6baa 100644 --- a/src/main/common/api.ts +++ b/src/main/common/api.ts @@ -139,7 +139,6 @@ class API extends DBInstance { public hideMainWindow(arg, window) { window.hide(); } - public showMainWindow(arg, window) { window.show(); } @@ -148,6 +147,10 @@ class API extends DBInstance { return dialog.showOpenDialogSync(window, data); } + public showSaveDialog({ data }, window) { + return dialog.showSaveDialogSync(window, data); + } + public setExpendHeight({ data: height }, window: BrowserWindow, e) { const originWindow = this.getCurrentWindow(window, e); if (!originWindow) return; diff --git a/src/main/common/registerHotKey.ts b/src/main/common/registerHotKey.ts index 984909e..782787f 100644 --- a/src/main/common/registerHotKey.ts +++ b/src/main/common/registerHotKey.ts @@ -15,10 +15,12 @@ const registerHotKey = (mainWindow: BrowserWindow): void => { // 设置开机启动 const setAutoLogin = async () => { const config = await localConfig.getConfig(); - app.setLoginItemSettings({ - openAtLogin: config.perf.common.start, - openAsHidden: true, - }); + if (app.getLoginItemSettings().openAtLogin !== config.perf.common.start) { + app.setLoginItemSettings({ + openAtLogin: config.perf.common.start, + openAsHidden: true, + }); + } }; const setTheme = async () => { @@ -86,10 +88,6 @@ const registerHotKey = (mainWindow: BrowserWindow): void => { }); }); - // globalShortcut.register(config.perf.shortCut.separate, () => { - // - // }); - globalShortcut.register(config.perf.shortCut.quit, () => { // mainWindow.webContents.send('init-rubick'); // mainWindow.show(); diff --git a/src/renderer/App.vue b/src/renderer/App.vue index df10810..5d9f6f7 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -27,18 +27,22 @@ :currentSelect="currentSelect" :options="options" :clipboardFile="clipboardFile || []" + @setPluginHistory="setPluginHistory" + @choosePlugin="choosePlugin" />