Position Revert/Gear button on the left of the label

+ Make the reverse arrow spin
This commit is contained in:
Henrik Giesel 2021-06-21 20:48:33 +02:00
parent 4e4683a122
commit e8a6add60b
7 changed files with 24 additions and 9 deletions

View file

@ -17,12 +17,10 @@
<Row> <Row>
<Col> <Col>
<RevertButton bind:value {defaultValue} />
<CheckBox bind:value <CheckBox bind:value
>{#if markdownTooltip}<TooltipLabel {markdownTooltip}><slot /></TooltipLabel >{#if markdownTooltip}<TooltipLabel {markdownTooltip}><slot /></TooltipLabel
>{:else}<Label><slot /></Label>{/if}</CheckBox >{:else}<Label><slot /></Label>{/if}</CheckBox
> >
</Col> </Col>
<Col grow={false}>
<RevertButton bind:value {defaultValue} />
</Col>
</Row> </Row>

View file

@ -20,10 +20,10 @@
<Row> <Row>
<Col size={7}> <Col size={7}>
<RevertButton bind:value {defaultValue} />
<TooltipLabel {markdownTooltip}><slot /></TooltipLabel> <TooltipLabel {markdownTooltip}><slot /></TooltipLabel>
</Col> </Col>
<Col {breakpoint} size={5}> <Col {breakpoint} size={5}>
<EnumSelector bind:value {choices} /> <EnumSelector bind:value {choices} />
<RevertButton bind:value {defaultValue} />
</Col> </Col>
</Row> </Row>

View file

@ -44,7 +44,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
let:menuId let:menuId
> >
<Badge <Badge
class={className} class={`p-1 ${className}`}
on:mount={(event) => createDropdown(event.detail.span)} on:mount={(event) => createDropdown(event.detail.span)}
on:click={activateDropdown} on:click={activateDropdown}
> >
@ -53,6 +53,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<DropdownMenu id={menuId}> <DropdownMenu id={menuId}>
<DropdownItem <DropdownItem
class="spinner"
on:click={() => { on:click={() => {
revert(); revert();
// Otherwise the menu won't close when the item is clicked // Otherwise the menu won't close when the item is clicked
@ -64,3 +65,19 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</DropdownItem> </DropdownItem>
</DropdownMenu> </DropdownMenu>
</WithDropdownMenu> </WithDropdownMenu>
<style lang="scss">
:global(.spinner:hover .badge) {
animation: spin-animation 1s infinite;
animation-timing-function: linear;
}
@keyframes -global-spin-animation {
0% {
transform: rotate(360deg);
}
100% {
transform: rotate(0deg);
}
}
</style>

View file

@ -18,10 +18,10 @@
<Row> <Row>
<Col size={7}> <Col size={7}>
<RevertButton bind:value {defaultValue} />
<TooltipLabel {markdownTooltip}><slot /></TooltipLabel> <TooltipLabel {markdownTooltip}><slot /></TooltipLabel>
</Col> </Col>
<Col size={5}> <Col size={5}>
<SpinBoxFloat bind:value {min} {max} /> <SpinBoxFloat bind:value {min} {max} />
<RevertButton bind:value {defaultValue} />
</Col> </Col>
</Row> </Row>

View file

@ -18,10 +18,10 @@
<Row> <Row>
<Col size={7}> <Col size={7}>
<RevertButton bind:value {defaultValue} />
<TooltipLabel {markdownTooltip}><slot /></TooltipLabel> <TooltipLabel {markdownTooltip}><slot /></TooltipLabel>
</Col> </Col>
<Col size={5}> <Col size={5}>
<SpinBox bind:value {min} {max} /> <SpinBox bind:value {min} {max} />
<RevertButton bind:value {defaultValue} />
</Col> </Col>
</Row> </Row>

View file

@ -16,10 +16,10 @@
<Row> <Row>
<Col size={7}> <Col size={7}>
<RevertButton bind:value {defaultValue} />
<TooltipLabel {markdownTooltip}><slot /></TooltipLabel> <TooltipLabel {markdownTooltip}><slot /></TooltipLabel>
</Col> </Col>
<Col size={5}> <Col size={5}>
<StepsInput bind:value /> <StepsInput bind:value />
<RevertButton bind:value {defaultValue} />
</Col> </Col>
</Row> </Row>

View file

@ -19,12 +19,12 @@
<Row> <Row>
<Col> <Col>
<RevertButton bind:value {defaultValue} />
{#if markdownTooltip}<TooltipLabel for={id} {markdownTooltip} {#if markdownTooltip}<TooltipLabel for={id} {markdownTooltip}
><slot /></TooltipLabel ><slot /></TooltipLabel
>{:else}<Label for={id}><slot /></Label>{/if} >{:else}<Label for={id}><slot /></Label>{/if}
</Col> </Col>
<Col grow={false}> <Col grow={false}>
<Switch {id} bind:value /> <Switch {id} bind:value />
<RevertButton bind:value {defaultValue} />
</Col> </Col>
</Row> </Row>