Skip to content

Commit

Permalink
Change: 複数選択時だけハイライトするように
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Jan 3, 2024
1 parent c799e59 commit 6d5fad4
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/components/AudioCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
active: isActiveAudioCell,
selected: isSelectedAudioCell && isMultiSelectEnabled,
}"
:data-should-highlight="selectedAudioKeys.length > 1"
@keydown.prevent.up="moveUpCell"
@keydown.prevent.down="moveDownCell"
@focus="onRootFocus"
Expand Down Expand Up @@ -282,8 +283,9 @@ const selectedVoice = computed<Voice | undefined>({
const isActiveAudioCell = computed(
() => props.audioKey === store.getters.ACTIVE_AUDIO_KEY
);
const selectedAudioKeys = computed(() => store.getters.SELECTED_AUDIO_KEYS);
const isSelectedAudioCell = computed(() =>
store.getters.SELECTED_AUDIO_KEYS.includes(props.audioKey)
selectedAudioKeys.value.includes(props.audioKey)
);
const audioTextBuffer = ref(audioItem.value.text);
Expand Down Expand Up @@ -410,15 +412,14 @@ const moveCell = (offset: number) => (e?: KeyboardEvent) => {
if (e && e.isComposing) return;
const index = audioKeys.value.indexOf(props.audioKey) + offset;
if (index >= 0 && index < audioKeys.value.length) {
const selectedAudioKeys = store.getters.SELECTED_AUDIO_KEYS;
if (isMultiSelectEnabled.value && e?.shiftKey) {
emit("focusCell", {
audioKey: audioKeys.value[index],
focusTarget: "root",
});
store.dispatch("SET_SELECTED_AUDIO_KEYS", {
audioKeys: [
...selectedAudioKeys,
...selectedAudioKeys.value,
props.audioKey,
audioKeys.value[index],
],
Expand Down Expand Up @@ -652,7 +653,7 @@ const isMultipleEngine = computed(() => store.state.engineIds.length > 1);
// divはフォーカスするとデフォルトで青い枠が出るので消す
outline: none;
}
&.selected {
&.selected[data-should-highlight="true"] {
background-color: colors.$active-point-focus;
}
Expand Down Expand Up @@ -707,12 +708,6 @@ const isMultipleEngine = computed(() => store.state.engineIds.length > 1);
}
}
&.selected
.q-input.q-field--filled.q-field--focused.q-field--highlighted
:deep(.q-field__control)::before {
background-color: colors.$background;
}
&:not(:hover) > .q-input > .q-field__after > .q-btn:not(:focus):not(:active) {
@include visually-hidden.visually-hidden;
}
Expand Down

0 comments on commit 6d5fad4

Please sign in to comment.