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

ContextMenuをContainer/Presentationに分離する #2376

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/components/Dialog/DictionaryManageDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
import { computed, ref, watch } from "vue";
import { QInput } from "quasar";
import AudioAccent from "@/components/Talk/AudioAccent.vue";
import ContextMenu from "@/components/Menu/ContextMenu.vue";
import ContextMenu from "@/components/Menu/ContextMenu/Container.vue";
import { useRightClickContextMenu } from "@/composables/useRightClickContextMenu";
import { useStore } from "@/store";
import type { FetchAudioResult } from "@/store/type";
Expand Down
32 changes: 32 additions & 0 deletions src/components/Menu/ContextMenu/Container.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<template>
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
<Presentation ref="contextMenu" :header :menudata :uiLocked />
</template>

<script setup lang="ts">
import { computed, useTemplateRef } from "vue";
import type { ComponentExposed } from "vue-component-type-helpers";
import Presentation, { ContextMenuItemData } from "./Presentation.vue";
import { useStore } from "@/store";

defineOptions({
name: "ContextMenu",
});

defineProps<{
header?: string;
menudata: ContextMenuItemData[];
}>();
defineExpose({
hide: () => {
contextMenu.value?.hide();
},
});

const store = useStore();
const uiLocked = computed(() => store.getters.UI_LOCKED);
const contextMenu =
useTemplateRef<ComponentExposed<typeof Presentation>>("contextMenu");
</script>
<script lang="ts">
export type { ContextMenuItemData } from "./Presentation.vue";
</script>
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,22 @@
</template>

<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref } from "vue";
import { onMounted, onUnmounted, ref } from "vue";
import { QMenu } from "quasar";
import MenuItem from "./MenuItem.vue";
import { MenuItemButton, MenuItemSeparator } from "./type";
import { useStore } from "@/store";
import MenuItem from "../MenuItem.vue";
import { MenuItemButton, MenuItemSeparator } from "../type";

defineProps<{
header?: string;
menudata: ContextMenuItemData[];

uiLocked?: boolean;
}>();
defineExpose({
hide: () => {
contextMenu.value?.hide();
},
});
const store = useStore();
const uiLocked = computed(() => store.getters.UI_LOCKED);

const contextMenu = ref<QMenu>();
/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sing/PlayheadPositionDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ref, computed } from "vue";
import { useStore } from "@/store";
import ContextMenu, {
ContextMenuItemData,
} from "@/components/Menu/ContextMenu.vue";
} from "@/components/Menu/ContextMenu/Container.vue";
import {
getTimeSignaturePositions,
MeasuresBeats,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sing/ScoreSequencer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ import {
} from "vue";
import ContextMenu, {
ContextMenuItemData,
} from "@/components/Menu/ContextMenu.vue";
} from "@/components/Menu/ContextMenu/Container.vue";
import { NoteId } from "@/type/preload";
import { useStore } from "@/store";
import { Note, SequencerEditTarget } from "@/store/type";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sing/SequencerNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import {
} from "@/sing/viewHelper";
import ContextMenu, {
ContextMenuItemData,
} from "@/components/Menu/ContextMenu.vue";
} from "@/components/Menu/ContextMenu/Container.vue";

const props = defineProps<{
note: Note;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sing/SideBar/TrackItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ import { computed, watchEffect, ref } from "vue";
import CharacterSelectMenu from "@/components/Sing/CharacterMenuButton/CharacterSelectMenu.vue";
import SingerIcon from "@/components/Sing/SingerIcon.vue";
import { useStore } from "@/store";
import ContextMenu from "@/components/Menu/ContextMenu.vue";
import ContextMenu from "@/components/Menu/ContextMenu/Container.vue";
import { shouldPlayTracks } from "@/sing/domain";
import { CharacterInfo, StyleInfo, TrackId } from "@/type/preload";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Talk/AccentPhrase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ import { computed, ref } from "vue";
import AudioAccent from "./AudioAccent.vue";
import AudioParameter from "./AudioParameter.vue";
import { MenuItemButton } from "@/components/Menu/type";
import ContextMenu from "@/components/Menu/ContextMenu.vue";
import ContextMenu from "@/components/Menu/ContextMenu/Container.vue";
import { useStore } from "@/store";
import { AudioKey, MoraDataType } from "@/type/preload";
import { Mora } from "@/openapi/models/Mora";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Talk/AudioCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ import { computed, watch, ref, nextTick } from "vue";
import { QInput } from "quasar";
import CharacterButton from "@/components/CharacterButton.vue";
import { MenuItemButton, MenuItemSeparator } from "@/components/Menu/type";
import ContextMenu from "@/components/Menu/ContextMenu.vue";
import ContextMenu from "@/components/Menu/ContextMenu/Container.vue";
import { useStore } from "@/store";
import { AudioKey, SplitTextWhenPasteType, Voice } from "@/type/preload";
import { SelectionHelperForQInput } from "@/helpers/SelectionHelperForQInput";
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useRightClickContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { QInput } from "quasar";
import { ref, Ref, nextTick } from "vue";
import { MenuItemButton, MenuItemSeparator } from "@/components/Menu/type";
import ContextMenu from "@/components/Menu/ContextMenu.vue";
import ContextMenu from "@/components/Menu/ContextMenu/Container.vue";
import { SelectionHelperForQInput } from "@/helpers/SelectionHelperForQInput";

/**
Expand Down
Loading