mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
Disable ColorButtons for Codable
This commit is contained in:
parent
c23665cf63
commit
2322d170fc
1 changed files with 52 additions and 41 deletions
|
@ -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,6 +29,7 @@ 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>
|
||||||
|
<OnlyEditable let:disabled>
|
||||||
<ButtonGroupItem>
|
<ButtonGroupItem>
|
||||||
<WithShortcut shortcut={"F7"} let:createShortcut let:shortcutLabel>
|
<WithShortcut shortcut={"F7"} let:createShortcut let:shortcutLabel>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
@ -35,6 +37,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
tr.editingSetForegroundColor(),
|
tr.editingSetForegroundColor(),
|
||||||
shortcutLabel
|
shortcutLabel
|
||||||
)}
|
)}
|
||||||
|
{disabled}
|
||||||
on:click={wrapWithForecolor(color)}
|
on:click={wrapWithForecolor(color)}
|
||||||
on:mount={createShortcut}
|
on:mount={createShortcut}
|
||||||
>
|
>
|
||||||
|
@ -51,6 +54,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
tr.editingChangeColor(),
|
tr.editingChangeColor(),
|
||||||
shortcutLabel
|
shortcutLabel
|
||||||
)}
|
)}
|
||||||
|
{disabled}
|
||||||
widthMultiplier={0.5}
|
widthMultiplier={0.5}
|
||||||
>
|
>
|
||||||
{@html arrowIcon}
|
{@html arrowIcon}
|
||||||
|
@ -58,21 +62,28 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</WithShortcut>
|
</WithShortcut>
|
||||||
</ButtonGroupItem>
|
</ButtonGroupItem>
|
||||||
|
</OnlyEditable>
|
||||||
</WithColorHelper>
|
</WithColorHelper>
|
||||||
|
|
||||||
<WithColorHelper let:colorHelperIcon let:color let:setColor>
|
<WithColorHelper let:colorHelperIcon let:color let:setColor>
|
||||||
|
<OnlyEditable let:disabled>
|
||||||
<ButtonGroupItem>
|
<ButtonGroupItem>
|
||||||
<IconButton on:click={wrapWithBackcolor(color)}>
|
<IconButton on:click={wrapWithBackcolor(color)} {disabled}>
|
||||||
{@html highlightColorIcon}
|
{@html highlightColorIcon}
|
||||||
{@html colorHelperIcon}
|
{@html colorHelperIcon}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</ButtonGroupItem>
|
</ButtonGroupItem>
|
||||||
|
|
||||||
<ButtonGroupItem>
|
<ButtonGroupItem>
|
||||||
<IconButton tooltip={tr.editingChangeColor()} widthMultiplier={0.5}>
|
<IconButton
|
||||||
|
tooltip={tr.editingChangeColor()}
|
||||||
|
widthMultiplier={0.5}
|
||||||
|
{disabled}
|
||||||
|
>
|
||||||
{@html arrowIcon}
|
{@html arrowIcon}
|
||||||
<ColorPicker on:change={setColor} />
|
<ColorPicker on:change={setColor} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</ButtonGroupItem>
|
</ButtonGroupItem>
|
||||||
|
</OnlyEditable>
|
||||||
</WithColorHelper>
|
</WithColorHelper>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|
Loading…
Reference in a new issue