Skip to content

Build your personal knowledge base with Trilium Notes

feat(options/text): improve formatting toolbar

Elian Doran9d4932455746
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index a58bf44784..07ab81d0c0 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -1930,6 +1930,7 @@
"editing": {
"editor_type": {
"label": "Formatting toolbar",
+ "toolbar_style": "Toolbar style",
"floating": {
"title": "Floating",
"description": "editing tools appear near the cursor;"
@@ -1938,7 +1939,7 @@
"title": "Fixed",
"description": "editing tools appear in the \"Formatting\" ribbon tab."
},
- "multiline-toolbar": "Display the toolbar on multiple lines if it doesn't fit."
+ "multiline-toolbar": "Display the toolbar on multiple lines if it doesn't fit"
}
},
"electron_context_menu": {
@@ -2193,6 +2194,8 @@
"related_code_blocks": "Color scheme for code blocks in text notes",
"related_code_notes": "Color scheme for code notes",
"ui": "User interface",
+ "ui_layout_style": "Layout style",
+ "ui_layout_orientation": "Launcher bar orientation",
"ui_old_layout": "Old layout",
"ui_new_layout": "New layout"
},
diff --git a/apps/client/src/widgets/type_widgets/options/text_notes.tsx b/apps/client/src/widgets/type_widgets/options/text_notes.tsx
index 5914ea8230..a476135cf9 100644
--- a/apps/client/src/widgets/type_widgets/options/text_notes.tsx
+++ b/apps/client/src/widgets/type_widgets/options/text_notes.tsx
@@ -9,7 +9,6 @@ import { isExperimentalFeatureEnabled } from "../../../services/experimental_fea
import { t } from "../../../services/i18n";
import { ensureMimeTypesForHighlighting, loadHighlightingTheme } from "../../../services/syntax_highlight";
import { formatDateTime, toggleBodyClass } from "../../../services/utils";
-import FormCheckbox from "../../react/FormCheckbox";
import FormGroup from "../../react/FormGroup";
import Dropdown from "../../react/Dropdown";
import { FormListItem } from "../../react/FormList";
@@ -44,28 +43,31 @@ function FormattingToolbar() {
return (
<OptionsSection title={t("editing.editor_type.label")}>
- <RadioWithIllustration
- currentValue={textNoteEditorType}
- onChange={setTextNoteEditorType}
- values={[
- {
- key: "ckeditor-balloon",
- text: t("editing.editor_type.floating.title"),
- illustration: <ToolbarIllustration type="floating" />
- },
- {
- key: "ckeditor-classic",
- text: t("editing.editor_type.fixed.title"),
- illustration: <ToolbarIllustration type="fixed" />
- }
- ]}
- />
+ <OptionsRow name="editor-type" label={t("editing.editor_type.toolbar_style")}>
+ <RadioWithIllustration
+ currentValue={textNoteEditorType}
+ onChange={setTextNoteEditorType}
+ values={[
+ {
+ key: "ckeditor-balloon",
+ text: t("editing.editor_type.floating.title"),
+ illustration: <ToolbarIllustration type="floating" />
+ },
+ {
+ key: "ckeditor-classic",
+ text: t("editing.editor_type.fixed.title"),
+ illustration: <ToolbarIllustration type="fixed" />
+ }
+ ]}
+ />
+ </OptionsRow>
- <FormCheckbox
+ <OptionsRowWithToggle
name="multiline-toolbar"
label={t("editing.editor_type.multiline-toolbar")}
- currentValue={textNoteEditorMultilineToolbar} onChange={setTextNoteEditorMultilineToolbar}
- containerStyle={{ marginTop: "1em" }}
+ currentValue={textNoteEditorMultilineToolbar}
+ onChange={setTextNoteEditorMultilineToolbar}
+ disabled={textNoteEditorType === "ckeditor-balloon"}
/>
</OptionsSection>
);