perf: 👷 Added edge hiding function switch

This commit is contained in:
viarotel 2025-01-13 17:27:53 +08:00
parent 85be8980d4
commit d25714a43f
8 changed files with 32 additions and 9 deletions

View File

@ -2,7 +2,7 @@ import Store from 'electron-store'
import { isEqual, set } from 'lodash-es' import { isEqual, set } from 'lodash-es'
import { createProxy } from './index.js' import { createProxy } from './index.js'
const appStore = new Store() const appStore = new Store({ watch: true })
// 如果没有数据则手动设置值,以保证配置文件生成成功 // 如果没有数据则手动设置值,以保证配置文件生成成功
if (isEqual(appStore.store, {})) { if (isEqual(appStore.store, {})) {

View File

@ -84,12 +84,20 @@ function createWindow() {
remote.enable(mainWindow.webContents) remote.enable(mainWindow.webContents)
remote.initialize() remote.initialize()
new Edger(mainWindow)
mainWindow.on('ready-to-show', () => { mainWindow.on('ready-to-show', () => {
mainWindow.show() mainWindow.show()
}) })
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url)
return { action: 'deny' }
})
const edgeHidden = appStore.get('common.edgeHidden')
if(edgeHidden) {
new Edger(mainWindow)
}
;['resize', 'move'].forEach((eventName) => { ;['resize', 'move'].forEach((eventName) => {
mainWindow.on(eventName, () => { mainWindow.on(eventName, () => {
if(mainWindow.isMaximized()) { if(mainWindow.isMaximized()) {
@ -103,11 +111,6 @@ function createWindow() {
}) })
}) })
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url)
return { action: 'deny' }
})
loadPage(mainWindow) loadPage(mainWindow)
ipc(mainWindow) ipc(mainWindow)

View File

@ -46,7 +46,7 @@
<el-tooltip <el-tooltip
v-if="item_1.tips" v-if="item_1.tips"
popper-class="max-w-96" popper-class="max-w-96"
effect="dark" effect="light"
:content="$t(item_1.tips)" :content="$t(item_1.tips)"
placement="bottom" placement="bottom"
> >

View File

@ -269,6 +269,9 @@
"preferences.common.auto-connect.placeholder": "When enabled, the software will attempt to automatically connect to historical devices upon startup.", "preferences.common.auto-connect.placeholder": "When enabled, the software will attempt to automatically connect to historical devices upon startup.",
"preferences.common.auto-mirror.name": "Auto Mirror", "preferences.common.auto-mirror.name": "Auto Mirror",
"preferences.common.auto-mirror.placeholder": "When enabled, devices in the device list will automatically execution the mirror.", "preferences.common.auto-mirror.placeholder": "When enabled, devices in the device list will automatically execution the mirror.",
"preferences.common.edgeHidden.name": "Auto-hide Main Panel",
"preferences.common.edgeHidden.placeholder": "When enabled, the main panel will automatically hide when mouse moves near screen edge",
"preferences.common.edgeHidden.tips": "Note: Changes require application restart to take effect",
"preferences.video.name": "Video", "preferences.video.name": "Video",
"preferences.video.disable-video.name": "Disable Video Forwarding", "preferences.video.disable-video.name": "Disable Video Forwarding",

View File

@ -269,6 +269,9 @@
"preferences.common.auto-connect.placeholder": "При включении программа попытается автоматически подключиться к историческим устройствам при запуске.", "preferences.common.auto-connect.placeholder": "При включении программа попытается автоматически подключиться к историческим устройствам при запуске.",
"preferences.common.auto-mirror.name": "Автозеркалирование", "preferences.common.auto-mirror.name": "Автозеркалирование",
"preferences.common.auto-mirror.placeholder": "При включении устройства в списке устройств будут автоматически зеркалироваться.", "preferences.common.auto-mirror.placeholder": "При включении устройства в списке устройств будут автоматически зеркалироваться.",
"preferences.common.edgeHidden.name": "Автоскрытие главной панели",
"preferences.common.edgeHidden.placeholder": "При включении главная панель будет автоматически скрываться, когда курсор приближается к краю экрана",
"preferences.common.edgeHidden.tips": "Примечание: Изменения вступят в силу после перезапуска приложения",
"preferences.video.name": "Видео", "preferences.video.name": "Видео",
"preferences.video.disable-video.name": "Отключить передачу видео", "preferences.video.disable-video.name": "Отключить передачу видео",

View File

@ -269,6 +269,9 @@
"preferences.common.auto-connect.placeholder": "启用后,该软件将在启动时尝试自动连接到历史无线设备", "preferences.common.auto-connect.placeholder": "启用后,该软件将在启动时尝试自动连接到历史无线设备",
"preferences.common.auto-mirror.name": "自动执行镜像", "preferences.common.auto-mirror.name": "自动执行镜像",
"preferences.common.auto-mirror.placeholder": "启用后,设备列表中的设备将自动运行镜像", "preferences.common.auto-mirror.placeholder": "启用后,设备列表中的设备将自动运行镜像",
"preferences.common.edgeHidden.name": "主面板贴边隐藏",
"preferences.common.edgeHidden.placeholder": "启用后,当鼠标靠近屏幕边缘离开面板时,主面板将自动隐藏。",
"preferences.common.edgeHidden.tips": "注意:更改此选项后,需要重启应用才能生效",
"preferences.video.name": "视频控制", "preferences.video.name": "视频控制",
"preferences.video.disable-video.name": "禁用视频转发", "preferences.video.disable-video.name": "禁用视频转发",

View File

@ -269,6 +269,9 @@
"preferences.common.auto-connect.placeholder": "啟用後,該軟體將在啟動時嘗試自動連接到歷史無線裝置", "preferences.common.auto-connect.placeholder": "啟用後,該軟體將在啟動時嘗試自動連接到歷史無線裝置",
"preferences.common.auto-mirror.name": "自動執行鏡像", "preferences.common.auto-mirror.name": "自動執行鏡像",
"preferences.common.auto-mirror.placeholder": "啟用後,裝置列表中的裝置將自動執行鏡像", "preferences.common.auto-mirror.placeholder": "啟用後,裝置列表中的裝置將自動執行鏡像",
"preferences.common.edgeHidden.name": "主面板貼邊隱藏",
"preferences.common.edgeHidden.placeholder": "啟用後,當滑鼠靠近螢幕邊緣離開面板時,主面板將自動隱藏",
"preferences.common.edgeHidden.tips": "注意:更改此選項後,需要重啟應用程式才能生效",
"preferences.video.name": "影片控制", "preferences.video.name": "影片控制",
"preferences.video.disable-video.name": "停用影片轉發", "preferences.video.disable-video.name": "停用影片轉發",

View File

@ -161,6 +161,14 @@ export default {
value: undefined, value: undefined,
placeholder: 'preferences.common.floatControl.placeholder', placeholder: 'preferences.common.floatControl.placeholder',
}, },
edgeHidden: {
label: 'preferences.common.edgeHidden.name',
field: 'edgeHidden',
type: 'Switch',
value: undefined,
placeholder: 'preferences.common.edgeHidden.placeholder',
tips: 'preferences.common.edgeHidden.tips',
},
debug: { debug: {
label: 'preferences.common.debug.name', label: 'preferences.common.debug.name',
field: 'debug', field: 'debug',