Skip to content

Commit

Permalink
perf: 🚀 Add volume control
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Nov 8, 2023
1 parent 6bddcbb commit 1505518
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 11 deletions.
18 changes: 10 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
dist-electron
dist-release
pnpm-lock.yaml
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand All @@ -25,3 +17,13 @@ pnpm-lock.yaml
*.njsproj
*.sln
*.sw?

# User
node_modules
pnpm-lock.yaml
*.local
dist
dist-ssr
dist-electron
dist-release
svgo
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build:linux": "vite build && electron-builder --linux",
"preview": "vite preview",
"lint": "eslint . --ext .md,.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .eslintignore --fix",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.config.js",
"svgo": "svgo --folder=src/icons/svgo --output=src/icons/svg --config=src/icons/svgo.config.js",
"postinstall": "electron-builder install-app-deps",
"prepare": "husky install"
},
Expand Down
19 changes: 17 additions & 2 deletions src/components/Device/components/ControlBar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
plain
class="!border-none !mx-0 bg-transparent !rounded-0"
:disabled="device.$unauthorized"
:title="item.tips ? $t(item.tips) : ''"
:title="$t(item.tips || item.label)"
:loading="loading"
@wheel.prevent="onWheel"
>
Expand Down Expand Up @@ -74,7 +74,7 @@ export default {
},
{
label: 'device.control.home',
elIcon: 'HomeFilled',
svgIcon: 'home',
command: 'input keyevent KEYCODE_HOME',
},
{
Expand All @@ -88,6 +88,21 @@ export default {
command: 'cmd statusbar expand-notifications',
tips: 'device.control.notification.tips',
},
{
label: 'device.control.volume-down.name',
svgIcon: 'volume-down',
command: 'input keyevent KEYCODE_VOLUME_DOWN',
},
{
label: 'device.control.volume-up.name',
svgIcon: 'volume-up',
command: 'input keyevent KEYCODE_VOLUME_UP',
},
{
label: 'device.control.volume-mute.name',
svgIcon: 'volume-mute',
command: 'input keyevent KEYCODE_VOLUME_MUTE',
},
{
label: 'device.control.power',
elIcon: 'SwitchButton',
Expand Down
1 change: 1 addition & 0 deletions src/icons/svg/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/svg/volume-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/svg/volume-mute.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/svg/volume-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/svgo.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
exclude: ['home.svg', 'volume-down.svg', 'volume-mute.svg', 'volume-up.svg'],
plugins: [
{
name: 'removeAttrs',
Expand Down
3 changes: 3 additions & 0 deletions src/locales/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
"device.control.mirror-group.name": "Mirror Group",
"device.control.mirror-group.tips": "When enabled, can mirror multiple simulated secondary displays and achieve multi-screen collaboration by operating each mirrored window. Note this requires ROM support and desktop mode enabled.",
"device.control.mirror-group.open": "Open {num} windows",
"device.control.volume-up.name": "Volume Up",
"device.control.volume-down.name": "Volume Down",
"device.control.volume-mute.name": "Mute",

"preferences.name": "Preferences",
"preferences.reset": "Reset to Default",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/languages/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
"device.control.mirror-group.name": "多屏协同",
"device.control.mirror-group.tips": "开启后,可以同时镜像多个模拟辅助显示设备,并通过操作各个镜像窗口实现多屏协同功能。请注意,此功能需要手机 ROM 支持,并且必须开启强制使用桌面模式选项。",
"device.control.mirror-group.open": "开启 {num} 个窗口",
"device.control.volume-up.name": "增加音量",
"device.control.volume-down.name": "减小音量",
"device.control.volume-mute.name": "静音",

"preferences.name": "偏好设置",
"preferences.reset": "恢复默认值",
Expand Down

0 comments on commit 1505518

Please sign in to comment.