Merge branch 'develop' into beta

This commit is contained in:
ThatOneCalculator 2023-06-24 15:17:43 -07:00
commit d3f4529295
2 changed files with 12 additions and 10 deletions

View file

@ -9,6 +9,7 @@
class="columns" class="columns"
:class="deckStore.reactiveState.columnAlign.value" :class="deckStore.reactiveState.columnAlign.value"
@contextmenu.self.prevent="onContextmenu" @contextmenu.self.prevent="onContextmenu"
@wheel.self="onWheel"
> >
<template v-for="ids in layout"> <template v-for="ids in layout">
<!-- sectionを利用しているのはdeck.vue側でcolumnに対してfirst-of-typeを効かせるため --> <!-- sectionを利用しているのはdeck.vue側でcolumnに対してfirst-of-typeを効かせるため -->
@ -31,6 +32,7 @@
) + 'px', ) + 'px',
} }
" "
@wheel.self="onWheel"
> >
<DeckColumnCore <DeckColumnCore
v-for="id in ids" v-for="id in ids"
@ -50,6 +52,7 @@
:is-stacked="false" :is-stacked="false"
:style="columns.find(c => c.id === ids[0])!.flexible ? { flex: 1, minWidth: '350px' } : { width: columns.find(c => c.id === ids[0])!.width + 'px' }" :style="columns.find(c => c.id === ids[0])!.flexible ? { flex: 1, minWidth: '350px' } : { width: columns.find(c => c.id === ids[0])!.width + 'px' }"
@parent-focus="moveFocus(ids[0], $event)" @parent-focus="moveFocus(ids[0], $event)"
@headerWheel="onWheel"
/> />
</template> </template>
<div v-if="layout.length === 0" class="intro _panel"> <div v-if="layout.length === 0" class="intro _panel">
@ -279,18 +282,15 @@ const onContextmenu = (ev) => {
); );
}; };
document.documentElement.style.overflowY = "hidden"; function onWheel(ev: WheelEvent) {
document.documentElement.style.scrollBehavior = "auto"; if (ev.deltaX === 0) {
window.addEventListener("wheel", (ev) => {
if (ev.target === columnsEl && ev.deltaX === 0) {
columnsEl.scrollLeft += ev.deltaY;
} else if (
getScrollContainer(ev.target as HTMLElement) == null &&
ev.deltaX === 0
) {
columnsEl.scrollLeft += ev.deltaY; columnsEl.scrollLeft += ev.deltaY;
} }
}); }
document.documentElement.style.overflowY = "hidden";
document.documentElement.style.scrollBehavior = "auto";
loadDeck(); loadDeck();
function moveFocus(id: string, direction: "up" | "down" | "left" | "right") { function moveFocus(id: string, direction: "up" | "down" | "left" | "right") {

View file

@ -23,6 +23,7 @@
@dragstart="onDragstart" @dragstart="onDragstart"
@dragend="onDragend" @dragend="onDragend"
@contextmenu.prevent.stop="onContextmenu" @contextmenu.prevent.stop="onContextmenu"
@wheel="emit('headerWheel', $event)"
> >
<button <button
v-if="isStacked && !isMainColumn" v-if="isStacked && !isMainColumn"
@ -95,6 +96,7 @@ const props = withDefaults(
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "parent-focus", direction: "up" | "down" | "left" | "right"): void; (ev: "parent-focus", direction: "up" | "down" | "left" | "right"): void;
(ev: "change-active-state", v: boolean): void; (ev: "change-active-state", v: boolean): void;
(ev: "headerWheel", ctx: WheelEvent): void;
}>(); }>();
let body = $ref<HTMLDivElement>(); let body = $ref<HTMLDivElement>();