Skip to content

Commit

Permalink
Optimize the boss key
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiram committed Apr 24, 2024
1 parent b88ee13 commit 3773f2a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/renderer/src/pages/setting/base/BaseSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ const formData = ref({
windowPosition: { status: false, position: { width: 1000, height: 640 } }
});
const tmp = reactive({
recordedSourceShortcut: ''
});
const filmEmitReload = useEventBus('film-reload');
const hotEmitReload = useEventBus('hot-reload');
const iptvEmitReload = useEventBus('iptv-reload');
Expand Down Expand Up @@ -450,16 +454,16 @@ const formatShortcut = computed(() => {
// 设置组合键更换焦点placeholder
const focusShortcut = () => {
// 复制快捷键
formData.value.recordedSourceShortcut = formData.value.recordShortcut;
tmp.recordedSourceShortcut = formData.value.recordShortcut;
formData.value.recordShortcut = '';
placeholderShortcut.value = t('pages.setting.placeholder.shortcutKeyEnterTip');
};
// 设置组合键更换失去焦点placeholder
const blurShortcut = () => {
// 还原快捷键
if (formData.value.recordedSourceShortcut && !formData.value.recordShortcut)
formData.value.recordShortcut = formData.value.recordedSourceShortcut;
if (tmp.recordedSourceShortcut && !formData.value.recordShortcut)
formData.value.recordShortcut = tmp.recordedSourceShortcut;
placeholderShortcut.value = t('pages.setting.placeholder.shortcutKeyTip');
};
Expand Down Expand Up @@ -586,6 +590,8 @@ const isLegalShortcut = (item) => {
const cancelShortcut = () => {
console.log('cancelShortcut');
formData.value.recordShortcut = '';
placeholderShortcut.value = t('pages.setting.placeholder.shortcutKeyTip');
tipShortcut.value = '';
window.electron.ipcRenderer.send('uninstallShortcut');
};
Expand All @@ -596,13 +602,15 @@ const reset = (type: string) => {
if (platform === 'darwin') formData.value.recordShortcut = 'Shift+Command+Z';
else formData.value.recordShortcut = 'Shift+Alt+Z';
shortcutInputRef.value.blur();
tipShortcut.value = '';
placeholderShortcut.value = t('pages.setting.placeholder.shortcutKeyTip');
window.electron.ipcRenderer.send('updateShortcut', { shortcut: formData.value.recordShortcut });
} else if (type === 'epg') {
formData.value.defaultIptvEpg = 'https://epg.112114.eu.org/';
} else if (type === 'logo') {
formData.value.defaultIptvLogo = 'https://epg.112114.eu.org/logo/';
} else if(type === 'danmuku') {
formData.value.defaultDanMuKu = 'https://dm.bbj.icu/dm?ac=dm';
formData.value.barrage.url = 'https://dm.bbj.icu/dm?ac=dm';
} else if(type === 'viewCasual') {
formData.value.defaultViewCasual = 'http://api.yujn.cn/api/zzxjj.php';
}
Expand Down

0 comments on commit 3773f2a

Please sign in to comment.