mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-30 03:47:22 +08:00
✨ feat: 添加mac状态栏播放按键控制功能开关
This commit is contained in:
@@ -66,7 +66,9 @@ export default {
|
|||||||
noMusicSources: 'No sources selected',
|
noMusicSources: 'No sources selected',
|
||||||
gdmusicInfo: 'GD Music Station intelligently resolves music from multiple platforms automatically',
|
gdmusicInfo: 'GD Music Station intelligently resolves music from multiple platforms automatically',
|
||||||
autoPlay: 'Auto Play',
|
autoPlay: 'Auto Play',
|
||||||
autoPlayDesc: 'Auto resume playback when reopening the app'
|
autoPlayDesc: 'Auto resume playback when reopening the app',
|
||||||
|
showStatusBar: "Show Status Bar",
|
||||||
|
showStatusBarContent: "You can display the music control function in your mac status bar (effective after a restart)"
|
||||||
},
|
},
|
||||||
application: {
|
application: {
|
||||||
closeAction: 'Close Action',
|
closeAction: 'Close Action',
|
||||||
|
|||||||
@@ -66,7 +66,9 @@ export default {
|
|||||||
noMusicSources: '未选择音源',
|
noMusicSources: '未选择音源',
|
||||||
gdmusicInfo: 'GD音乐台可自动解析多个平台音源,自动选择最佳结果',
|
gdmusicInfo: 'GD音乐台可自动解析多个平台音源,自动选择最佳结果',
|
||||||
autoPlay: '自动播放',
|
autoPlay: '自动播放',
|
||||||
autoPlayDesc: '重新打开应用时是否自动继续播放'
|
autoPlayDesc: '重新打开应用时是否自动继续播放',
|
||||||
|
showStatusBar: '是否显示状态栏控制功能',
|
||||||
|
showStatusBarContent: '可以在您的mac状态栏显示音乐控制功能(重启后生效)',
|
||||||
},
|
},
|
||||||
application: {
|
application: {
|
||||||
closeAction: '关闭行为',
|
closeAction: '关闭行为',
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ type SetConfig = {
|
|||||||
fontFamily: string;
|
fontFamily: string;
|
||||||
fontScope: 'global' | 'lyric';
|
fontScope: 'global' | 'lyric';
|
||||||
language: string;
|
language: string;
|
||||||
|
showTopAction: boolean;
|
||||||
};
|
};
|
||||||
interface StoreType {
|
interface StoreType {
|
||||||
set: SetConfig;
|
set: SetConfig;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { join } from 'path';
|
|||||||
|
|
||||||
import type { Language } from '../../i18n/main';
|
import type { Language } from '../../i18n/main';
|
||||||
import i18n from '../../i18n/main';
|
import i18n from '../../i18n/main';
|
||||||
|
import { getStore } from './config';
|
||||||
|
|
||||||
// 歌曲信息接口定义
|
// 歌曲信息接口定义
|
||||||
interface SongInfo {
|
interface SongInfo {
|
||||||
@@ -327,7 +328,8 @@ export function updateTrayMenu(mainWindow: BrowserWindow) {
|
|||||||
|
|
||||||
// 初始化状态栏Tray
|
// 初始化状态栏Tray
|
||||||
function initializeStatusBarTray(mainWindow: BrowserWindow) {
|
function initializeStatusBarTray(mainWindow: BrowserWindow) {
|
||||||
if (process.platform !== 'darwin') return;
|
const store = getStore()
|
||||||
|
if (process.platform !== 'darwin' || !store.get('set.showTopAction')) return;
|
||||||
|
|
||||||
const iconSize = getProperIconSize();
|
const iconSize = getProperIconSize();
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -23,5 +23,6 @@
|
|||||||
"alwaysShowDownloadButton": false,
|
"alwaysShowDownloadButton": false,
|
||||||
"unlimitedDownload": false,
|
"unlimitedDownload": false,
|
||||||
"enableMusicUnblock": true,
|
"enableMusicUnblock": true,
|
||||||
"enabledMusicSources": ["migu", "kugou", "pyncmd", "bilibili", "kuwo"]
|
"enabledMusicSources": ["migu", "kugou", "pyncmd", "bilibili", "kuwo"],
|
||||||
|
"showTopAction": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,6 +183,17 @@
|
|||||||
</n-button>
|
</n-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="set-item" v-if="platform === 'darwin'">
|
||||||
|
<div>
|
||||||
|
<div class="set-item-title">{{ t('settings.playback.showStatusBar') }}</div>
|
||||||
|
<div class="set-item-content">{{ t('settings.playback.showStatusBarContent') }}</div>
|
||||||
|
</div>
|
||||||
|
<n-switch v-model:value="setData.showTopAction">
|
||||||
|
<template #checked>{{ t('common.on') }}</template>
|
||||||
|
<template #unchecked>{{ t('common.off') }}</template>
|
||||||
|
</n-switch>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="set-item">
|
<div class="set-item">
|
||||||
<div>
|
<div>
|
||||||
<div class="set-item-title">{{ t('settings.playback.autoPlay') }}</div>
|
<div class="set-item-title">{{ t('settings.playback.autoPlay') }}</div>
|
||||||
@@ -488,6 +499,8 @@ import config from '../../../../package.json';
|
|||||||
// 所有平台默认值
|
// 所有平台默认值
|
||||||
const ALL_PLATFORMS: Platform[] = ['migu', 'kugou', 'pyncmd', 'bilibili', 'kuwo'];
|
const ALL_PLATFORMS: Platform[] = ['migu', 'kugou', 'pyncmd', 'bilibili', 'kuwo'];
|
||||||
|
|
||||||
|
const platform = window.electron.ipcRenderer.sendSync('get-platform');
|
||||||
|
|
||||||
const settingsStore = useSettingsStore();
|
const settingsStore = useSettingsStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user