Give OptionsButton its own ButtonGroup and move it to more prominent position (#2207)

and give it some padding
This commit is contained in:
Matthias Metelka 2022-11-23 07:18:29 +01:00 committed by GitHub
parent fba46e9815
commit e9430fde3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 6 deletions

View File

@ -46,7 +46,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}
@include button.border-radius;
padding: 0;
padding: 0 var(--padding-inline, 0);
font-size: var(--base-font-size);
height: var(--buttons-size);
min-width: calc(var(--buttons-size) * 0.75);

View File

@ -57,7 +57,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import BlockButtons from "./BlockButtons.svelte";
import InlineButtons from "./InlineButtons.svelte";
import NotetypeButtons from "./NotetypeButtons.svelte";
import OptionsButton from "./OptionsButton.svelte";
import OptionsButtons from "./OptionsButtons.svelte";
import RichTextClozeButtons from "./RichTextClozeButtons.svelte";
import TemplateButtons from "./TemplateButtons.svelte";
@ -66,6 +66,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
const toolbar = {} as DefaultSlotInterface;
const notetypeButtons = {} as DefaultSlotInterface;
const optionsButtons = {} as DefaultSlotInterface;
const inlineButtons = {} as DefaultSlotInterface;
const blockButtons = {} as DefaultSlotInterface;
const templateButtons = {} as DefaultSlotInterface;
@ -100,6 +101,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</NotetypeButtons>
</Item>
<Item id="settings">
<OptionsButtons api={optionsButtons} />
</Item>
<Item id="inlineFormatting">
<InlineButtons api={inlineButtons} />
</Item>
@ -115,10 +120,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<Item id="cloze">
<RichTextClozeButtons />
</Item>
<Item id="options">
<OptionsButton />
</Item>
</DynamicallySlottable>
</ButtonToolbar>
</div>

View File

@ -41,6 +41,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
tooltip={tr.actionsOptions()}
--border-left-radius="5px"
--border-right-radius="5px"
--padding-inline="8px"
on:click={() => (showFloating = !showFloating)}
>
{@html cogIcon}

View File

@ -0,0 +1,30 @@
<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import ButtonGroup from "../../components/ButtonGroup.svelte";
import ButtonGroupItem, {
createProps,
setSlotHostContext,
updatePropsList,
} from "../../components/ButtonGroupItem.svelte";
import DynamicallySlottable from "../../components/DynamicallySlottable.svelte";
import OptionsButton from "./OptionsButton.svelte";
export let api = {};
</script>
<ButtonGroup>
<DynamicallySlottable
slotHost={ButtonGroupItem}
{createProps}
{updatePropsList}
{setSlotHostContext}
{api}
>
<ButtonGroupItem id="options">
<OptionsButton />
</ButtonGroupItem>
</DynamicallySlottable>
</ButtonGroup>