Disable ColorButtons for Codable

This commit is contained in:
Henrik Giesel 2021-06-18 01:44:15 +02:00
parent c23665cf63
commit 2322d170fc

View file

@ -11,6 +11,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import ColorPicker from "components/ColorPicker.svelte"; import ColorPicker from "components/ColorPicker.svelte";
import WithShortcut from "components/WithShortcut.svelte"; import WithShortcut from "components/WithShortcut.svelte";
import WithColorHelper from "./WithColorHelper.svelte"; import WithColorHelper from "./WithColorHelper.svelte";
import OnlyEditable from "./OnlyEditable.svelte";
import { textColorIcon, highlightColorIcon, arrowIcon } from "./icons"; import { textColorIcon, highlightColorIcon, arrowIcon } from "./icons";
import { appendInParentheses } from "./helpers"; import { appendInParentheses } from "./helpers";
@ -28,51 +29,61 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<ButtonGroup {api}> <ButtonGroup {api}>
<WithColorHelper let:colorHelperIcon let:color let:setColor> <WithColorHelper let:colorHelperIcon let:color let:setColor>
<ButtonGroupItem> <OnlyEditable let:disabled>
<WithShortcut shortcut={"F7"} let:createShortcut let:shortcutLabel> <ButtonGroupItem>
<IconButton <WithShortcut shortcut={"F7"} let:createShortcut let:shortcutLabel>
tooltip={appendInParentheses( <IconButton
tr.editingSetForegroundColor(), tooltip={appendInParentheses(
shortcutLabel tr.editingSetForegroundColor(),
)} shortcutLabel
on:click={wrapWithForecolor(color)} )}
on:mount={createShortcut} {disabled}
> on:click={wrapWithForecolor(color)}
{@html textColorIcon} on:mount={createShortcut}
{@html colorHelperIcon} >
</IconButton> {@html textColorIcon}
</WithShortcut> {@html colorHelperIcon}
</ButtonGroupItem> </IconButton>
</WithShortcut>
</ButtonGroupItem>
<ButtonGroupItem> <ButtonGroupItem>
<WithShortcut shortcut={"F8"} let:createShortcut let:shortcutLabel> <WithShortcut shortcut={"F8"} let:createShortcut let:shortcutLabel>
<IconButton <IconButton
tooltip={appendInParentheses( tooltip={appendInParentheses(
tr.editingChangeColor(), tr.editingChangeColor(),
shortcutLabel shortcutLabel
)} )}
widthMultiplier={0.5} {disabled}
> widthMultiplier={0.5}
{@html arrowIcon} >
<ColorPicker on:change={setColor} on:mount={createShortcut} /> {@html arrowIcon}
</IconButton> <ColorPicker on:change={setColor} on:mount={createShortcut} />
</WithShortcut> </IconButton>
</ButtonGroupItem> </WithShortcut>
</ButtonGroupItem>
</OnlyEditable>
</WithColorHelper> </WithColorHelper>
<WithColorHelper let:colorHelperIcon let:color let:setColor> <WithColorHelper let:colorHelperIcon let:color let:setColor>
<ButtonGroupItem> <OnlyEditable let:disabled>
<IconButton on:click={wrapWithBackcolor(color)}> <ButtonGroupItem>
{@html highlightColorIcon} <IconButton on:click={wrapWithBackcolor(color)} {disabled}>
{@html colorHelperIcon} {@html highlightColorIcon}
</IconButton> {@html colorHelperIcon}
</ButtonGroupItem> </IconButton>
</ButtonGroupItem>
<ButtonGroupItem> <ButtonGroupItem>
<IconButton tooltip={tr.editingChangeColor()} widthMultiplier={0.5}> <IconButton
{@html arrowIcon} tooltip={tr.editingChangeColor()}
<ColorPicker on:change={setColor} /> widthMultiplier={0.5}
</IconButton> {disabled}
</ButtonGroupItem> >
{@html arrowIcon}
<ColorPicker on:change={setColor} />
</IconButton>
</ButtonGroupItem>
</OnlyEditable>
</WithColorHelper> </WithColorHelper>
</ButtonGroup> </ButtonGroup>