|
@@ -345,6 +345,7 @@ function VerticalSessionTabs(props: { controller?: SessionTabsController; animat
|
|
|
let rail: { screenX: number; screenY: number } | undefined
|
|
let rail: { screenX: number; screenY: number } | undefined
|
|
|
let scroll: ScrollBoxRenderable | undefined
|
|
let scroll: ScrollBoxRenderable | undefined
|
|
|
let didDrag = false
|
|
let didDrag = false
|
|
|
|
|
+ let addPressed = false
|
|
|
// A captured drag ends with a synthetic up on its drop target; do not turn that into a click.
|
|
// A captured drag ends with a synthetic up on its drop target; do not turn that into a click.
|
|
|
let suppressClick = false
|
|
let suppressClick = false
|
|
|
|
|
|
|
@@ -760,7 +761,8 @@ function VerticalSessionTabs(props: { controller?: SessionTabsController; animat
|
|
|
onMouseDown={(event: MouseEvent) => {
|
|
onMouseDown={(event: MouseEvent) => {
|
|
|
didDrag = false
|
|
didDrag = false
|
|
|
setDragging(undefined)
|
|
setDragging(undefined)
|
|
|
- if (event.button !== RIGHT_MOUSE_BUTTON) return
|
|
|
|
|
|
|
+ addPressed = event.button !== RIGHT_MOUSE_BUTTON
|
|
|
|
|
+ if (addPressed) return
|
|
|
if (!rail) return
|
|
if (!rail) return
|
|
|
setContextMenu({ x: event.x, y: event.y })
|
|
setContextMenu({ x: event.x, y: event.y })
|
|
|
event.preventDefault()
|
|
event.preventDefault()
|
|
@@ -769,8 +771,11 @@ function VerticalSessionTabs(props: { controller?: SessionTabsController; animat
|
|
|
onMouseUp={(event: MouseEvent) => {
|
|
onMouseUp={(event: MouseEvent) => {
|
|
|
if (event.button === RIGHT_MOUSE_BUTTON) return
|
|
if (event.button === RIGHT_MOUSE_BUTTON) return
|
|
|
if (suppressClick) return
|
|
if (suppressClick) return
|
|
|
|
|
+ if (!addPressed) return
|
|
|
|
|
+ addPressed = false
|
|
|
if (!newTab()) tabs.add?.()
|
|
if (!newTab()) tabs.add?.()
|
|
|
}}
|
|
}}
|
|
|
|
|
+ onMouseDragEnd={() => (addPressed = false)}
|
|
|
>
|
|
>
|
|
|
<text
|
|
<text
|
|
|
width={2}
|
|
width={2}
|
|
@@ -837,6 +842,7 @@ function HorizontalSessionTabs(props: { controller?: SessionTabsController; anim
|
|
|
const [contextMenu, setContextMenu] = createSignal<TabContextMenuState>()
|
|
const [contextMenu, setContextMenu] = createSignal<TabContextMenuState>()
|
|
|
let strip: { screenX: number; screenY: number } | undefined
|
|
let strip: { screenX: number; screenY: number } | undefined
|
|
|
let didDrag = false
|
|
let didDrag = false
|
|
|
|
|
+ let addPressed = false
|
|
|
// A captured drag ends with a synthetic up on its drop target; do not turn that into a click.
|
|
// A captured drag ends with a synthetic up on its drop target; do not turn that into a click.
|
|
|
let suppressClick = false
|
|
let suppressClick = false
|
|
|
const hueStep = () => (mode() === "light" ? 800 : 200)
|
|
const hueStep = () => (mode() === "light" ? 800 : 200)
|
|
@@ -1203,7 +1209,8 @@ function HorizontalSessionTabs(props: { controller?: SessionTabsController; anim
|
|
|
onMouseDown={(event) => {
|
|
onMouseDown={(event) => {
|
|
|
didDrag = false
|
|
didDrag = false
|
|
|
setDragging(undefined)
|
|
setDragging(undefined)
|
|
|
- if (event.button !== RIGHT_MOUSE_BUTTON) return
|
|
|
|
|
|
|
+ addPressed = event.button !== RIGHT_MOUSE_BUTTON
|
|
|
|
|
+ if (addPressed) return
|
|
|
setContextMenu({ x: event.x, y: event.y })
|
|
setContextMenu({ x: event.x, y: event.y })
|
|
|
event.preventDefault()
|
|
event.preventDefault()
|
|
|
event.stopPropagation()
|
|
event.stopPropagation()
|
|
@@ -1211,8 +1218,11 @@ function HorizontalSessionTabs(props: { controller?: SessionTabsController; anim
|
|
|
onMouseUp={(event) => {
|
|
onMouseUp={(event) => {
|
|
|
if (event.button === RIGHT_MOUSE_BUTTON) return
|
|
if (event.button === RIGHT_MOUSE_BUTTON) return
|
|
|
if (suppressClick) return
|
|
if (suppressClick) return
|
|
|
|
|
+ if (!addPressed) return
|
|
|
|
|
+ addPressed = false
|
|
|
tabs.add?.()
|
|
tabs.add?.()
|
|
|
}}
|
|
}}
|
|
|
|
|
+ onMouseDragEnd={() => (addPressed = false)}
|
|
|
>
|
|
>
|
|
|
{" + "}
|
|
{" + "}
|
|
|
</text>
|
|
</text>
|