Remove ConfigEntryFull

This commit is contained in:
Henrik Giesel 2021-05-29 00:33:59 +02:00
parent 6e06f4afd4
commit 77ea7f5e6f
6 changed files with 97 additions and 74 deletions

View file

@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import * as tr from "lib/i18n";
import marked from "marked";
import TitledContainer from "./TitledContainer.svelte";
import ConfigEntryFull from "./ConfigEntryFull.svelte";
import ConfigEntry from "./ConfigEntry.svelte";
import HelpPopup from "./HelpPopup.svelte";
import CheckBox from "./CheckBox.svelte";
import RevertButton from "./RevertButton.svelte";
@ -18,26 +18,34 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</script>
<TitledContainer title={tr.deckConfigAudioTitle()}>
<ConfigEntryFull>
<CheckBox bind:value={$config.disableAutoplay}>
{tr.deckConfigDisableAutoplay()}
</CheckBox>
<RevertButton
defaultValue={defaults.disableAutoplay}
bind:value={$config.disableAutoplay}
/>
</ConfigEntryFull>
<ConfigEntryFull>
<CheckBox bind:value={$config.skipQuestionWhenReplayingAnswer}>
{tr.schedulingAlwaysIncludeQuestionSideWhenReplaying()}
<HelpPopup
html={marked(tr.deckConfigAlwaysIncludeQuestionAudioTooltip())}
<ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.disableAutoplay}>
{tr.deckConfigDisableAutoplay()}
</CheckBox>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton
defaultValue={defaults.disableAutoplay}
bind:value={$config.disableAutoplay}
/>
</CheckBox>
<RevertButton
defaultValue={defaults.skipQuestionWhenReplayingAnswer}
bind:value={$config.skipQuestionWhenReplayingAnswer}
/>
</ConfigEntryFull>
</svelte:fragment>
</ConfigEntry>
<ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.skipQuestionWhenReplayingAnswer}>
{tr.schedulingAlwaysIncludeQuestionSideWhenReplaying()}
<HelpPopup
html={marked(tr.deckConfigAlwaysIncludeQuestionAudioTooltip())}
/>
</CheckBox>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton
defaultValue={defaults.skipQuestionWhenReplayingAnswer}
bind:value={$config.skipQuestionWhenReplayingAnswer}
/>
</svelte:fragment>
</ConfigEntry>
</TitledContainer>

View file

@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import * as tr from "lib/i18n";
import marked from "marked";
import TitledContainer from "./TitledContainer.svelte";
import ConfigEntryFull from "./ConfigEntryFull.svelte";
import ConfigEntry from "./ConfigEntry.svelte";
import HelpPopup from "./HelpPopup.svelte";
import CheckBox from "./CheckBox.svelte";
import RevertButton from "./RevertButton.svelte";
@ -18,22 +18,33 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</script>
<TitledContainer title={tr.deckConfigBuryTitle()}>
<ConfigEntryFull>
<CheckBox bind:value={$config.buryNew}>
{tr.deckConfigBuryNewSiblings()}
<HelpPopup html={marked(tr.deckConfigBuryTooltip())} />
</CheckBox>
<RevertButton defaultValue={defaults.buryNew} bind:value={$config.buryNew} />
</ConfigEntryFull>
<ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.buryNew}>
{tr.deckConfigBuryNewSiblings()}
<HelpPopup html={marked(tr.deckConfigBuryTooltip())} />
</CheckBox>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton
defaultValue={defaults.buryNew}
bind:value={$config.buryNew}
/>
</svelte:fragment>
</ConfigEntry>
<ConfigEntryFull>
<CheckBox bind:value={$config.buryReviews}>
{tr.deckConfigBuryReviewSiblings()}
<HelpPopup html={marked(tr.deckConfigBuryTooltip())} />
</CheckBox>
<RevertButton
defaultValue={defaults.buryReviews}
bind:value={$config.buryReviews}
/>
</ConfigEntryFull>
<ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.buryReviews}>
{tr.deckConfigBuryReviewSiblings()}
<HelpPopup html={marked(tr.deckConfigBuryTooltip())} />
</CheckBox>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton
defaultValue={defaults.buryReviews}
bind:value={$config.buryReviews}
/>
</svelte:fragment>
</ConfigEntry>
</TitledContainer>

View file

@ -10,11 +10,21 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</script>
<Row {id}>
<div class="col-7 d-flex align-items-center">
<slot name="left" />
</div>
{#if $$slots.center}
<div class="col-7 d-flex align-items-center">
<slot name="left" />
</div>
<div class:col-5={!wrap} class:col-sm-5={wrap} class="d-flex align-items-center">
<div class="col-4 d-flex align-items-center">
<slot name="center" />
</div>
{:else}
<div class="col-11 d-flex align-items-center">
<slot name="left" />
</div>
{/if}
<div class="col-1 d-flex align-items-center">
<slot name="right" />
</div>
</Row>

View file

@ -1,15 +0,0 @@
<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import Row from "./Row.svelte";
export let id: string | undefined = undefined;
</script>
<Row {id}>
<div class="col-12 d-flex align-items-center">
<slot />
</div>
</Row>

View file

@ -40,11 +40,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
html={marked(tr.deckConfigRelearningStepsTooltip())}
/>
</span>
<svelte:fragment slot="right">
<svelte:fragment slot="center">
<StepsInput
value={$config.relearnSteps}
on:changed={(evt) => ($config.relearnSteps = evt.detail.value)}
/>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton
defaultValue={defaults.relearnSteps}
value={$config.relearnSteps}
@ -75,8 +77,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
html={marked(tr.deckConfigLeechThresholdTooltip())}
/>
</span>
<svelte:fragment slot="right">
<svelte:fragment slot="center">
<SpinBox min={1} bind:value={$config.leechThreshold} />
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton
defaultValue={defaults.leechThreshold}
bind:value={$config.leechThreshold}
@ -84,14 +88,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</svelte:fragment>
</ConfigEntry>
<ConfigEntry wrap={true}>
<ConfigEntry>
<span slot="left">
{tr.schedulingLeechAction()}<HelpPopup
html={marked(tr.deckConfigLeechActionTooltip())}
/>
</span>
<svelte:fragment slot="right">
<svelte:fragment slot="center">
<EnumSelector choices={leechChoices} bind:value={$config.leechAction} />
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton
defaultValue={defaults.leechAction}
bind:value={$config.leechAction}

View file

@ -7,7 +7,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import marked from "marked";
import TitledContainer from "./TitledContainer.svelte";
import ConfigEntry from "./ConfigEntry.svelte";
import ConfigEntryFull from "./ConfigEntryFull.svelte";
import HelpPopup from "./HelpPopup.svelte";
import SpinBox from "./SpinBox.svelte";
import CheckBox from "./CheckBox.svelte";
@ -34,14 +33,18 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</svelte:fragment>
</ConfigEntry>
<ConfigEntryFull>
<CheckBox bind:value={$config.showTimer}>
{tr.schedulingShowAnswerTimer()}
<HelpPopup html={marked(tr.deckConfigShowAnswerTimerTooltip())} />
</CheckBox>
<RevertButton
defaultValue={defaults.showTimer}
bind:value={$config.showTimer}
/>
</ConfigEntryFull>
<ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.showTimer}>
{tr.schedulingShowAnswerTimer()}
<HelpPopup html={marked(tr.deckConfigShowAnswerTimerTooltip())} />
</CheckBox>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton
defaultValue={defaults.showTimer}
bind:value={$config.showTimer}
/>
</svelte:fragment>
</ConfigEntry>
</TitledContainer>