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 * as tr from "lib/i18n";
import marked from "marked"; import marked from "marked";
import TitledContainer from "./TitledContainer.svelte"; import TitledContainer from "./TitledContainer.svelte";
import ConfigEntryFull from "./ConfigEntryFull.svelte"; import ConfigEntry from "./ConfigEntry.svelte";
import HelpPopup from "./HelpPopup.svelte"; import HelpPopup from "./HelpPopup.svelte";
import CheckBox from "./CheckBox.svelte"; import CheckBox from "./CheckBox.svelte";
import RevertButton from "./RevertButton.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> </script>
<TitledContainer title={tr.deckConfigAudioTitle()}> <TitledContainer title={tr.deckConfigAudioTitle()}>
<ConfigEntryFull> <ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.disableAutoplay}> <CheckBox bind:value={$config.disableAutoplay}>
{tr.deckConfigDisableAutoplay()} {tr.deckConfigDisableAutoplay()}
</CheckBox> </CheckBox>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton <RevertButton
defaultValue={defaults.disableAutoplay} defaultValue={defaults.disableAutoplay}
bind:value={$config.disableAutoplay} bind:value={$config.disableAutoplay}
/> />
</ConfigEntryFull> </svelte:fragment>
</ConfigEntry>
<ConfigEntryFull> <ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.skipQuestionWhenReplayingAnswer}> <CheckBox bind:value={$config.skipQuestionWhenReplayingAnswer}>
{tr.schedulingAlwaysIncludeQuestionSideWhenReplaying()} {tr.schedulingAlwaysIncludeQuestionSideWhenReplaying()}
<HelpPopup <HelpPopup
html={marked(tr.deckConfigAlwaysIncludeQuestionAudioTooltip())} html={marked(tr.deckConfigAlwaysIncludeQuestionAudioTooltip())}
/> />
</CheckBox> </CheckBox>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton <RevertButton
defaultValue={defaults.skipQuestionWhenReplayingAnswer} defaultValue={defaults.skipQuestionWhenReplayingAnswer}
bind:value={$config.skipQuestionWhenReplayingAnswer} bind:value={$config.skipQuestionWhenReplayingAnswer}
/> />
</ConfigEntryFull> </svelte:fragment>
</ConfigEntry>
</TitledContainer> </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 * as tr from "lib/i18n";
import marked from "marked"; import marked from "marked";
import TitledContainer from "./TitledContainer.svelte"; import TitledContainer from "./TitledContainer.svelte";
import ConfigEntryFull from "./ConfigEntryFull.svelte"; import ConfigEntry from "./ConfigEntry.svelte";
import HelpPopup from "./HelpPopup.svelte"; import HelpPopup from "./HelpPopup.svelte";
import CheckBox from "./CheckBox.svelte"; import CheckBox from "./CheckBox.svelte";
import RevertButton from "./RevertButton.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> </script>
<TitledContainer title={tr.deckConfigBuryTitle()}> <TitledContainer title={tr.deckConfigBuryTitle()}>
<ConfigEntryFull> <ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.buryNew}> <CheckBox bind:value={$config.buryNew}>
{tr.deckConfigBuryNewSiblings()} {tr.deckConfigBuryNewSiblings()}
<HelpPopup html={marked(tr.deckConfigBuryTooltip())} /> <HelpPopup html={marked(tr.deckConfigBuryTooltip())} />
</CheckBox> </CheckBox>
<RevertButton defaultValue={defaults.buryNew} bind:value={$config.buryNew} /> </svelte:fragment>
</ConfigEntryFull> <svelte:fragment slot="right">
<RevertButton
defaultValue={defaults.buryNew}
bind:value={$config.buryNew}
/>
</svelte:fragment>
</ConfigEntry>
<ConfigEntryFull> <ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.buryReviews}> <CheckBox bind:value={$config.buryReviews}>
{tr.deckConfigBuryReviewSiblings()} {tr.deckConfigBuryReviewSiblings()}
<HelpPopup html={marked(tr.deckConfigBuryTooltip())} /> <HelpPopup html={marked(tr.deckConfigBuryTooltip())} />
</CheckBox> </CheckBox>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton <RevertButton
defaultValue={defaults.buryReviews} defaultValue={defaults.buryReviews}
bind:value={$config.buryReviews} bind:value={$config.buryReviews}
/> />
</ConfigEntryFull> </svelte:fragment>
</ConfigEntry>
</TitledContainer> </TitledContainer>

View file

@ -10,11 +10,21 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</script> </script>
<Row {id}> <Row {id}>
{#if $$slots.center}
<div class="col-7 d-flex align-items-center"> <div class="col-7 d-flex align-items-center">
<slot name="left" /> <slot name="left" />
</div> </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" /> <slot name="right" />
</div> </div>
</Row> </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())} html={marked(tr.deckConfigRelearningStepsTooltip())}
/> />
</span> </span>
<svelte:fragment slot="right"> <svelte:fragment slot="center">
<StepsInput <StepsInput
value={$config.relearnSteps} value={$config.relearnSteps}
on:changed={(evt) => ($config.relearnSteps = evt.detail.value)} on:changed={(evt) => ($config.relearnSteps = evt.detail.value)}
/> />
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton <RevertButton
defaultValue={defaults.relearnSteps} defaultValue={defaults.relearnSteps}
value={$config.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())} html={marked(tr.deckConfigLeechThresholdTooltip())}
/> />
</span> </span>
<svelte:fragment slot="right"> <svelte:fragment slot="center">
<SpinBox min={1} bind:value={$config.leechThreshold} /> <SpinBox min={1} bind:value={$config.leechThreshold} />
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton <RevertButton
defaultValue={defaults.leechThreshold} defaultValue={defaults.leechThreshold}
bind:value={$config.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> </svelte:fragment>
</ConfigEntry> </ConfigEntry>
<ConfigEntry wrap={true}> <ConfigEntry>
<span slot="left"> <span slot="left">
{tr.schedulingLeechAction()}<HelpPopup {tr.schedulingLeechAction()}<HelpPopup
html={marked(tr.deckConfigLeechActionTooltip())} html={marked(tr.deckConfigLeechActionTooltip())}
/> />
</span> </span>
<svelte:fragment slot="right"> <svelte:fragment slot="center">
<EnumSelector choices={leechChoices} bind:value={$config.leechAction} /> <EnumSelector choices={leechChoices} bind:value={$config.leechAction} />
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton <RevertButton
defaultValue={defaults.leechAction} defaultValue={defaults.leechAction}
bind:value={$config.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 marked from "marked";
import TitledContainer from "./TitledContainer.svelte"; import TitledContainer from "./TitledContainer.svelte";
import ConfigEntry from "./ConfigEntry.svelte"; import ConfigEntry from "./ConfigEntry.svelte";
import ConfigEntryFull from "./ConfigEntryFull.svelte";
import HelpPopup from "./HelpPopup.svelte"; import HelpPopup from "./HelpPopup.svelte";
import SpinBox from "./SpinBox.svelte"; import SpinBox from "./SpinBox.svelte";
import CheckBox from "./CheckBox.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> </svelte:fragment>
</ConfigEntry> </ConfigEntry>
<ConfigEntryFull> <ConfigEntry>
<svelte:fragment slot="left">
<CheckBox bind:value={$config.showTimer}> <CheckBox bind:value={$config.showTimer}>
{tr.schedulingShowAnswerTimer()} {tr.schedulingShowAnswerTimer()}
<HelpPopup html={marked(tr.deckConfigShowAnswerTimerTooltip())} /> <HelpPopup html={marked(tr.deckConfigShowAnswerTimerTooltip())} />
</CheckBox> </CheckBox>
</svelte:fragment>
<svelte:fragment slot="right">
<RevertButton <RevertButton
defaultValue={defaults.showTimer} defaultValue={defaults.showTimer}
bind:value={$config.showTimer} bind:value={$config.showTimer}
/> />
</ConfigEntryFull> </svelte:fragment>
</ConfigEntry>
</TitledContainer> </TitledContainer>