2023-07-27 14:45:49 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
2023-11-03 12:55:38 +01:00
|
|
|
import * as tr from "@tslib/ftl";
|
2023-07-27 14:45:49 +02:00
|
|
|
import ButtonGroup from "components/ButtonGroup.svelte";
|
|
|
|
import DynamicallySlottable from "components/DynamicallySlottable.svelte";
|
|
|
|
import IconButton from "components/IconButton.svelte";
|
2023-11-24 05:06:40 +01:00
|
|
|
import { ioImageLoadedStore, ioMaskEditorVisible } from "image-occlusion/store";
|
2023-07-27 14:45:49 +02:00
|
|
|
|
|
|
|
import ButtonGroupItem, {
|
|
|
|
createProps,
|
|
|
|
setSlotHostContext,
|
|
|
|
updatePropsList,
|
|
|
|
} from "../../components/ButtonGroupItem.svelte";
|
2023-11-24 05:06:40 +01:00
|
|
|
import { mdiTableRefresh, mdiViewDashboard } from "./icons";
|
2023-07-27 14:45:49 +02:00
|
|
|
|
|
|
|
export let api = {};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<ButtonGroup>
|
|
|
|
<DynamicallySlottable
|
|
|
|
slotHost={ButtonGroupItem}
|
|
|
|
{createProps}
|
|
|
|
{updatePropsList}
|
|
|
|
{setSlotHostContext}
|
|
|
|
{api}
|
|
|
|
>
|
|
|
|
<ButtonGroupItem>
|
|
|
|
<IconButton
|
|
|
|
id="io-mask-btn"
|
|
|
|
class={$ioMaskEditorVisible ? "active-io-btn" : ""}
|
|
|
|
on:click={() => {
|
|
|
|
$ioMaskEditorVisible = !$ioMaskEditorVisible;
|
|
|
|
}}
|
2023-11-03 12:55:38 +01:00
|
|
|
tooltip={tr.editingImageOcclusionToggleMaskEditor()}
|
2023-07-27 14:45:49 +02:00
|
|
|
>
|
|
|
|
{@html mdiViewDashboard}
|
|
|
|
</IconButton>
|
|
|
|
</ButtonGroupItem>
|
2023-11-24 05:06:40 +01:00
|
|
|
<ButtonGroupItem>
|
|
|
|
<IconButton
|
|
|
|
id="io-reset-btn"
|
|
|
|
disabled={!$ioImageLoadedStore}
|
|
|
|
on:click={() => {
|
|
|
|
if (confirm(tr.editingImageOcclusionConfirmReset())) {
|
|
|
|
globalThis.resetIOImageLoaded();
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
tooltip={tr.editingImageOcclusionReset()}
|
|
|
|
>
|
|
|
|
{@html mdiTableRefresh}
|
|
|
|
</IconButton>
|
|
|
|
</ButtonGroupItem>
|
2023-07-27 14:45:49 +02:00
|
|
|
</DynamicallySlottable>
|
|
|
|
</ButtonGroup>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
:global(.active-io-btn) {
|
|
|
|
background: var(--button-primary-bg) !important;
|
|
|
|
color: white !important;
|
|
|
|
}
|
|
|
|
</style>
|