Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] ソングで保存ショートカットキーが効かないバグを修正 #2023

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions src/components/Menu/MenuBar/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import TitleBarButtons from "./TitleBarButtons.vue";
import TitleBarEditorSwitcher from "./TitleBarEditorSwitcher.vue";
import { useStore } from "@/store";
import { base64ImageToUri } from "@/helpers/imageHelper";
import { useHotkeyManager } from "@/plugins/hotkeyPlugin";
import { HotkeyAction, useHotkeyManager } from "@/plugins/hotkeyPlugin";

const props = defineProps<{
/** 「ファイル」メニューのサブメニュー */
Expand Down Expand Up @@ -477,23 +477,34 @@ watch(uiLocked, () => {
}
});

registerHotkeyWithCleanup({
editor: props.editor,
/**
* 全エディタに対してホットキーを登録する
* FIXME: hotkeyPlugin側で全エディタに対して登録できるようにする
*/
function registerHotkeyForAllEditors(action: Omit<HotkeyAction, "editor">) {
registerHotkeyWithCleanup({
editor: "talk",
...action,
});
registerHotkeyWithCleanup({
editor: "song",
...action,
});
}

registerHotkeyForAllEditors({
callback: createNewProject,
name: "新規プロジェクト",
});
registerHotkeyWithCleanup({
editor: props.editor,
registerHotkeyForAllEditors({
callback: saveProject,
name: "プロジェクトを上書き保存",
});
registerHotkeyWithCleanup({
editor: props.editor,
registerHotkeyForAllEditors({
callback: saveProjectAs,
name: "プロジェクトを名前を付けて保存",
});
registerHotkeyWithCleanup({
editor: props.editor,
registerHotkeyForAllEditors({
callback: importProject,
name: "プロジェクト読み込み",
});
Expand Down
Loading