mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-20 16:11:46 +03:00
only show hunk line grab cursor if dragging is enabled
This commit is contained in:
parent
913d4b0eeb
commit
68d9de295e
@ -11,6 +11,7 @@
|
||||
export let selectable: boolean = false;
|
||||
export let selected: boolean = true;
|
||||
export let readonly: boolean = false;
|
||||
export let draggingDisabled: boolean = false;
|
||||
|
||||
const dispatch = createEventDispatcher<{ selected: boolean }>();
|
||||
|
||||
@ -63,6 +64,7 @@
|
||||
class:readonly
|
||||
class:diff-line-deletion={sectionType === SectionType.RemovedLines}
|
||||
class:diff-line-addition={sectionType === SectionType.AddedLines}
|
||||
style:cursor={draggingDisabled ? 'default' : 'grab'}
|
||||
>
|
||||
<span class="selectable-wrapper" data-no-drag>
|
||||
{@html toTokens(line.content).join('')}
|
||||
@ -82,9 +84,6 @@
|
||||
|
||||
.line {
|
||||
flex-grow: 1;
|
||||
&:not(.readonly) {
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
|
||||
.code-line__numbers-line {
|
||||
|
@ -43,6 +43,8 @@
|
||||
|
||||
$: popupMenu = updateContextMenu(filePath);
|
||||
|
||||
$: draggingDisabled = readonly || isUnapplied || section.hunk.locked || !branchId;
|
||||
|
||||
onDestroy(() => {
|
||||
if (popupMenu) {
|
||||
popupMenu.$destroy();
|
||||
@ -55,7 +57,7 @@
|
||||
role="cell"
|
||||
use:draggable={{
|
||||
...draggableHunk(branchId, section.hunk),
|
||||
disabled: readonly || isUnapplied || section.hunk.locked || !branchId
|
||||
disabled: draggingDisabled
|
||||
}}
|
||||
on:contextmenu|preventDefault
|
||||
class="hunk"
|
||||
@ -72,6 +74,7 @@
|
||||
{readonly}
|
||||
{minWidth}
|
||||
{selectable}
|
||||
{draggingDisabled}
|
||||
selected={$selectedOwnership?.containsHunk(hunk.filePath, hunk.id)}
|
||||
on:selected={(e) => onHunkSelected(hunk, e.detail)}
|
||||
sectionType={subsection.sectionType}
|
||||
|
Loading…
Reference in New Issue
Block a user