mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
Add paragraph button
This commit is contained in:
parent
5bc8385f8b
commit
fcb2ab28e3
3 changed files with 16 additions and 3 deletions
|
@ -77,6 +77,7 @@ copy_bootstrap_icons(
|
|||
"mic.svg",
|
||||
|
||||
# block formatting
|
||||
"paragraph.svg",
|
||||
"list-ul.svg",
|
||||
"list-ol.svg",
|
||||
"text-paragraph.svg",
|
||||
|
|
|
@ -15,6 +15,7 @@ import type { IconButtonProps } from "./IconButton";
|
|||
import { DynamicSvelteComponent, dynamicComponent } from "sveltelib/dynamicComponent";
|
||||
import * as tr from "anki/i18n";
|
||||
|
||||
import paragraphIcon from "./paragraph.svg";
|
||||
import ulIcon from "./list-ul.svg";
|
||||
import olIcon from "./list-ol.svg";
|
||||
import listOptionsIcon from "./text-paragraph.svg";
|
||||
|
@ -109,6 +110,12 @@ const iconButton = dynamicComponent<typeof IconButton, IconButtonProps>(IconButt
|
|||
|
||||
export function getFormatBlockGroup(): DynamicSvelteComponent<typeof ButtonGroup> &
|
||||
ButtonGroupProps {
|
||||
const paragraphButton = commandIconButton({
|
||||
icon: paragraphIcon,
|
||||
command: "formatBlock",
|
||||
tooltip: tr.editingUnorderedList(),
|
||||
});
|
||||
|
||||
const ulButton = commandIconButton({
|
||||
icon: ulIcon,
|
||||
command: "insertUnorderedList",
|
||||
|
@ -131,7 +138,12 @@ export function getFormatBlockGroup(): DynamicSvelteComponent<typeof ButtonGroup
|
|||
});
|
||||
|
||||
return buttonGroup({
|
||||
id: "formatBlock",
|
||||
buttons: [ulButton, olButton, listFormatting],
|
||||
id: "blockFormatting",
|
||||
buttons: [
|
||||
paragraphButton,
|
||||
ulButton,
|
||||
olButton,
|
||||
listFormatting,
|
||||
],
|
||||
});
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ export function getFormatInlineGroup(): DynamicSvelteComponent<typeof ButtonGrou
|
|||
});
|
||||
|
||||
return buttonGroup({
|
||||
id: "formatInline",
|
||||
id: "inlineFormatting",
|
||||
buttons: [
|
||||
boldButton,
|
||||
italicButton,
|
||||
|
|
Loading…
Reference in a new issue