Skip to content

Commit

Permalink
トーク:全選択ショートカットキーをctrl+Aに変更する (#2044)
Browse files Browse the repository at this point in the history
* 全選択ショートカットキーをctrl+Aに変更する

* 有効なときのみ実行するようにした
  • Loading branch information
Hiroshiba authored May 25, 2024
1 parent 024d360 commit da7e57c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
31 changes: 19 additions & 12 deletions src/components/Menu/MenuBar/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ const titleText = computed(
);
const canUndo = computed(() => store.getters.CAN_UNDO(props.editor));
const canRedo = computed(() => store.getters.CAN_REDO(props.editor));
const isMultiSelectEnabled = computed(
() => store.state.experimentalSetting.enableMultiSelect,
);
// FIXME: App.vue内に移動する
watch(titleText, (newTitle) => {
Expand Down Expand Up @@ -362,18 +365,22 @@ const menudata = computed<MenuItemData[]>(() => [
disabled: !canRedo.value,
disableWhenUiLocked: true,
},
{
type: "button",
label: "全セルを選択",
onClick: async () => {
if (!uiLocked.value) {
await store.dispatch("SET_SELECTED_AUDIO_KEYS", {
audioKeys: audioKeys.value,
});
}
},
disableWhenUiLocked: true,
},
...(isMultiSelectEnabled.value
? [
{
type: "button",
label: "すべて選択",
onClick: async () => {
if (!uiLocked.value && isMultiSelectEnabled.value) {
await store.dispatch("SET_SELECTED_AUDIO_KEYS", {
audioKeys: audioKeys.value,
});
}
},
disableWhenUiLocked: true,
} as const,
]
: []),
...props.editSubMenuData,
],
},
Expand Down
8 changes: 6 additions & 2 deletions src/components/Talk/TalkEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ const store = useStore();
const audioKeys = computed(() => store.state.audioKeys);
const uiLocked = computed(() => store.getters.UI_LOCKED);
const isMultiSelectEnabled = computed(
() => store.state.experimentalSetting.enableMultiSelect,
);
const { registerHotkeyWithCleanup } = useHotkeyManager();
registerHotkeyWithCleanup({
Expand Down Expand Up @@ -251,9 +255,9 @@ registerHotkeyWithCleanup({
registerHotkeyWithCleanup({
editor: "talk",
enableInTextbox: false,
name: "全セルを選択",
name: "すべて選択",
callback: () => {
if (!uiLocked.value) {
if (!uiLocked.value && isMultiSelectEnabled.value) {
store.dispatch("SET_SELECTED_AUDIO_KEYS", {
audioKeys: audioKeys.value,
});
Expand Down
4 changes: 0 additions & 4 deletions src/type/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@ export const defaultHotkeySettings: HotkeySettingType[] = [
action: "選択解除",
combination: HotkeyCombination("Escape"),
},
{
action: "全セルを選択",
combination: HotkeyCombination(!isMac ? "Ctrl Shift A" : "Meta Shift A"),
},
...Array.from({ length: 10 }, (_, index) => {
const roleKey = index == 9 ? 0 : index + 1;
return {
Expand Down

0 comments on commit da7e57c

Please sign in to comment.