Use different background colour for readonly cells

This commit is contained in:
Andrew Kingston 2023-04-21 10:55:27 +01:00
parent b44e6ddea6
commit aa98cf72f5
2 changed files with 5 additions and 1 deletions

View File

@ -67,6 +67,7 @@
{rowIdx} {rowIdx}
{focused} {focused}
{selectedUser} {selectedUser}
{readonly}
error={$error} error={$error}
on:click={() => focusedCellId.set(cellId)} on:click={() => focusedCellId.set(cellId)}
on:contextmenu={e => menu.actions.open(cellId, e)} on:contextmenu={e => menu.actions.open(cellId, e)}

View File

@ -8,6 +8,7 @@
export let rowIdx export let rowIdx
export let defaultHeight = false export let defaultHeight = false
export let center = false export let center = false
export let readonly = false
$: style = getStyle(width, selectedUser) $: style = getStyle(width, selectedUser)
@ -27,6 +28,7 @@
class:focused class:focused
class:error class:error
class:center class:center
class:readonly
class:default-height={defaultHeight} class:default-height={defaultHeight}
class:selected-other={selectedUser != null} class:selected-other={selectedUser != null}
on:focus on:focus
@ -121,7 +123,8 @@
.cell:hover { .cell:hover {
cursor: default; cursor: default;
} }
.cell.highlighted:not(.focused) { .cell.highlighted:not(.focused),
.cell.focused.readonly {
--cell-background: var(--cell-background-hover); --cell-background: var(--cell-background-hover);
} }
.cell.selected:not(.focused) { .cell.selected:not(.focused) {