1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Desktop: Resolves #1900: Allow selecting what views should be available from the Layout button (#2028)

* Added options for selecting layout

* Toggle through the layouts based on config

* Used redux state for getting layout settings

* Removed duplicated strings for layout options

* Moved option for selecting layouts to "View" menu
This commit is contained in:
Subodh Dahal
2019-10-31 09:42:17 +01:00
committed by Laurent Cozic
parent 316746605e
commit f450ef09cc
2 changed files with 59 additions and 11 deletions

View File

@ -233,6 +233,19 @@ class Setting extends BaseModel {
return output;
},
},
layout: {
value: Setting.LAYOUT_ALL,
type: Setting.TYPE_INT,
public: false,
appTypes: ['desktop'],
isEnum: true,
options: () => ({
[Setting.LAYOUT_ALL]: _('%s / %s / %s', _('Editor'), _('Viewer'), _('Split View')),
[Setting.LAYOUT_EDITOR_VIEWER]: _('%s / %s', _('Editor'), _('Viewer')),
[Setting.LAYOUT_EDITOR_SPLIT]: _('%s / %s', _('Editor'), _('Split View')),
[Setting.LAYOUT_VIEWER_SPLIT]: _('%s / %s', _('Viewer'), _('Split View')),
}),
},
uncompletedTodosOnTop: { value: true, type: Setting.TYPE_BOOL, section: 'note', public: true, appTypes: ['cli'], label: () => _('Uncompleted to-dos on top') },
showCompletedTodos: { value: true, type: Setting.TYPE_BOOL, section: 'note', public: true, appTypes: ['cli'], label: () => _('Show completed to-dos') },
'notes.sortOrder.field': {
@ -923,6 +936,11 @@ Setting.FONT_COURIER_NEW = 2;
Setting.FONT_AVENIR = 3;
Setting.FONT_MONOSPACE = 4;
Setting.LAYOUT_ALL = 0;
Setting.LAYOUT_EDITOR_VIEWER = 1;
Setting.LAYOUT_EDITOR_SPLIT = 2;
Setting.LAYOUT_VIEWER_SPLIT = 3;
Setting.DATE_FORMAT_1 = 'DD/MM/YYYY';
Setting.DATE_FORMAT_2 = 'DD/MM/YY';
Setting.DATE_FORMAT_3 = 'MM/DD/YYYY';