minor fixes

This commit is contained in:
poanse 2025-12-23 05:43:45 +03:00
parent 4615e84a11
commit 4a08bfa147
5 changed files with 40 additions and 22 deletions

View file

@ -64,13 +64,13 @@
"
>
<circle
cx="12" cy="12" r="10"
cx="12" cy="12" r="11"
/>
<path
stroke-width="1.5"
stroke-width="2"
d="M5 12h14"
/><path
stroke-width="1.5"
stroke-width="2"
d="M12 5v14"
/>
</svg>

View file

@ -1,7 +1,7 @@
<script lang="ts">
import type {Context} from "../Context.svelte.js";
import {IconCode, StatusCode} from "../types";
import {Circle, KeyRound, LocateFixed, Lock, RectangleHorizontal, Trash2} from 'lucide-svelte';
import {Circle, KeyRound, LocateFixed, Lock, RectangleHorizontal, Trash2, Crosshair } from 'lucide-svelte';
let {
iconCode,
@ -61,8 +61,8 @@
}
let classString = $derived(`
${isPressed ? 'is-pressed-up': ''}
${isPressedDown ? 'is-pressed-down': '' }
${isPressed ? 'is-pressed-up ': ''}
${isPressedDown ? 'is-pressed-down ': '' }
${iconCode === IconCode.STATUS ? " " + ["draft", "ready", "in-progress", "done"][context.toolbarStatus]: ""}
`);
</script>
@ -99,7 +99,7 @@
{:else if iconCode === IconCode.LOCK}
<Lock class={classString}/>
{:else if iconCode === IconCode.FOCUS}
<LocateFixed class={classString}/>
<LocateFixed class={classString + " focus"}/>
{:else if iconCode === IconCode.STATUS}
<Circle class={classString}/>
{:else if iconCode === IconCode.STATUS_DRAFT}
@ -148,6 +148,10 @@
stroke-width: 0.083;
fill: #bbb;
}
:global(svg.focus) {
width: 21px;
height: 21px;
}
:global(svg.draft) {
stroke: #7E7E7E;
fill: #1E1E1E;

View file

@ -28,6 +28,6 @@
transition: stroke 0.2s;
pointer-events: none; /* Let clicks pass through to nodes below */
stroke: #555;
stroke-width: 4;
stroke-width: 3;
}
</style>

View file

@ -123,6 +123,11 @@
mouseDown = true;
event.stopPropagation();
}}
onpointerdown={(event: MouseEvent) => {
mouseDown = true;
event.stopPropagation();
}}
onpointerup={onTaskClick}
onclick={onTaskClick}
onblur={() => finishEditing(true)}
role="presentation"
@ -193,6 +198,7 @@
height: 84px;
border-width: 4px;
transform: translate3d(-2px,-2px,0);
cursor: pointer;
}
.task.draft {
border-color: #7E7E7E;

View file

@ -45,6 +45,7 @@
}
});
function handlePreviewClick(e: MouseEvent) {
console.log('task text clicked');
const target = e.target as HTMLElement;
// Check if the clicked element (or its parent) is an internal link
@ -139,7 +140,7 @@
class="task-text-container"
class:selected={isSelected}
class:not-selected={!isSelected}
onclick={handlePreviewClick}
onpointerup={handlePreviewClick}
>
{#if isEditing}
<textarea
@ -155,7 +156,7 @@
class="text-preview tasktext"
tabindex="0"
bind:this={textPreviewEl}
onclick={handlePreviewClick}
onpointerup={handlePreviewClick}
onmouseover={handlePreviewMouseOver}
>
</div>
@ -205,7 +206,7 @@
cursor: text;
}
.task-text-container.not-selected .tasktext:hover {
cursor: default;
/*cursor: default;*/
}
.text-edit {
@ -221,18 +222,25 @@
outline: none;
box-shadow: none;
}
.text-preview p {
top: 50%;
line-height: 1.5;
margin: 0;
padding: 0;
gap: 0;
border: none;
text-align: center;
justify-content: center;
align-items: center;
.text-preview {
overflow: visible;
white-space: pre-wrap;
word-wrap: break-word;
overflow: visible;
p {
top: 0;
width: 160px;
height: 60px;
line-height: 1.5;
margin: 0;
padding: 0;
gap: 0;
border: none;
text-align: center;
justify-content: center;
align-items: center;
/*white-space: pre-wrap;*/
/*word-wrap: break-word;*/
overflow: visible;
}
}
</style>