1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: Allow setting a max width for the editor content

This commit is contained in:
Laurent Cozic
2021-08-14 12:19:53 +01:00
parent a9961ae3ec
commit 8063c94ff7
9 changed files with 87 additions and 23 deletions

View File

@ -159,8 +159,8 @@ function NoteEditor(props: NoteEditorProps) {
customCss: props.customCss,
});
return markupToHtml.allAssets(markupLanguage, theme);
}, [props.themeId, props.customCss]);
return markupToHtml.allAssets(markupLanguage, theme, { contentMaxWidth: props.contentMaxWidth });
}, [props.themeId, props.customCss, props.contentMaxWidth]);
const handleProvisionalFlag = useCallback(() => {
if (props.isProvisional) {
@ -400,6 +400,7 @@ function NoteEditor(props: NoteEditorProps) {
noteToolbarButtonInfos: props.toolbarButtonInfos,
plugins: props.plugins,
fontSize: Setting.value('style.editor.fontSize'),
contentMaxWidth: props.contentMaxWidth,
};
let editor = null;
@ -601,6 +602,7 @@ const mapStateToProps = (state: AppState) => {
setTagsToolbarButtonInfo: toolbarButtonUtils.commandsToToolbarButtons([
'setTags',
], whenClauseContext)[0],
contentMaxWidth: state.settings['style.editor.contentMaxWidth'],
};
};