mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-02 12:47:41 +02:00
Mobile: Configurable editor font size (#7596)
This commit is contained in:
parent
2feed88c51
commit
0530c74924
@ -99,9 +99,16 @@ function useHtml(css: string): string {
|
||||
}
|
||||
|
||||
function editorTheme(themeId: number) {
|
||||
const fontSizeInPx = Setting.value('style.editor.fontSize');
|
||||
|
||||
// Convert from `px` to `em`. To support font size scaling based on
|
||||
// system accessibility settings, we need to provide font sizes in `em`.
|
||||
// 16px is about 1em with the default root font size.
|
||||
const estimatedFontSizeInEm = fontSizeInPx / 16;
|
||||
|
||||
return {
|
||||
...themeStyle(themeId),
|
||||
fontSize: 0.85, // em
|
||||
fontSize: estimatedFontSizeInEm,
|
||||
fontFamily: fontFamilyFromSettings(),
|
||||
};
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ class NoteScreenComponent extends BaseScreenComponent {
|
||||
textAlignVertical: 'top',
|
||||
color: theme.color,
|
||||
backgroundColor: theme.backgroundColor,
|
||||
fontSize: theme.fontSize,
|
||||
fontSize: this.props.editorFontSize,
|
||||
fontFamily: editorFont(this.props.editorFont),
|
||||
},
|
||||
noteBodyViewer: {
|
||||
@ -1237,6 +1237,7 @@ const NoteScreen = connect((state: any) => {
|
||||
searchQuery: state.searchQuery,
|
||||
themeId: state.settings.theme,
|
||||
editorFont: [state.settings['style.editor.fontFamily']],
|
||||
editorFontSize: state.settings['style.editor.fontSize'],
|
||||
ftsEnabled: state.settings['db.ftsEnabled'],
|
||||
sharedData: state.sharedData,
|
||||
showSideMenu: state.showSideMenu,
|
||||
|
@ -1194,7 +1194,19 @@ class Setting extends BaseModel {
|
||||
// Deprecated in favour of windowContentZoomFactor
|
||||
'style.zoom': { value: 100, type: SettingItemType.Int, public: false, storage: SettingStorage.File, isGlobal: true, appTypes: [AppType.Desktop], section: 'appearance', label: () => '', minimum: 50, maximum: 500, step: 10 },
|
||||
|
||||
'style.editor.fontSize': { value: 15, type: SettingItemType.Int, public: true, storage: SettingStorage.File, isGlobal: true, appTypes: [AppType.Desktop], section: 'appearance', label: () => _('Editor font size'), minimum: 4, maximum: 50, step: 1 },
|
||||
'style.editor.fontSize': {
|
||||
value: 15,
|
||||
type: SettingItemType.Int,
|
||||
public: true,
|
||||
storage: SettingStorage.File,
|
||||
isGlobal: true,
|
||||
appTypes: [AppType.Desktop, AppType.Mobile],
|
||||
section: 'appearance',
|
||||
label: () => _('Editor font size'),
|
||||
minimum: 4,
|
||||
maximum: 50,
|
||||
step: 1,
|
||||
},
|
||||
'style.editor.fontFamily':
|
||||
(mobilePlatform) ?
|
||||
({
|
||||
|
Loading…
Reference in New Issue
Block a user