1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

CLI: Made layout configurable (#3069)

This commit is contained in:
Yuvaraj J 2020-05-09 20:42:09 +05:30 committed by GitHub
parent 17d2d6f959
commit 06eb389b21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 3 deletions

View File

@ -5,6 +5,7 @@ const Tag = require('lib/models/Tag.js');
const BaseModel = require('lib/BaseModel.js');
const Note = require('lib/models/Note.js');
const Resource = require('lib/models/Resource.js');
const Setting = require('lib/models/Setting.js');
const { reducer, defaultState } = require('lib/reducer.js');
const { splitCommandString } = require('lib/string-utils.js');
const { reg } = require('lib/registry.js');
@ -243,9 +244,9 @@ class AppGui {
const hLayout = new HLayoutWidget();
hLayout.name = 'hLayout';
hLayout.addChild(folderList, { type: 'stretch', factor: 1 });
hLayout.addChild(noteList, { type: 'stretch', factor: 1 });
hLayout.addChild(noteLayout, { type: 'stretch', factor: 2 });
hLayout.addChild(folderList, { type: 'stretch', factor: Setting.value('layout.folderList.factor') });
hLayout.addChild(noteList, { type: 'stretch', factor: Setting.value('layout.noteList.factor') });
hLayout.addChild(noteLayout, { type: 'stretch', factor: Setting.value('layout.note.factor') });
const vLayout = new VLayoutWidget();
vLayout.name = 'vLayout';

View File

@ -629,6 +629,46 @@ class Setting extends BaseModel {
maximum: 300,
step: 10,
},
'layout.folderList.factor': {
value: 1,
type: Setting.TYPE_INT,
section: 'appearance',
public: true,
appTypes: ['cli'],
label: () => _('Notebook list growth factor'),
description: () =>
_('The factor property sets how the item will grow or shrink ' +
'to fit the available space in its container with respect to the other items. ' +
'Thus an item with a factor of 2 will take twice as much space as an item with a factor of 1.' +
'Restart app to see changes.'),
},
'layout.noteList.factor': {
value: 1,
type: Setting.TYPE_INT,
section: 'appearance',
public: true,
appTypes: ['cli'],
label: () => _('Note list growth factor'),
description: () =>
_('The factor property sets how the item will grow or shrink ' +
'to fit the available space in its container with respect to the other items. ' +
'Thus an item with a factor of 2 will take twice as much space as an item with a factor of 1.' +
'Restart app to see changes.'),
},
'layout.note.factor': {
value: 2,
type: Setting.TYPE_INT,
section: 'appearance',
public: true,
appTypes: ['cli'],
label: () => _('Note area growth factor'),
description: () =>
_('The factor property sets how the item will grow or shrink ' +
'to fit the available space in its container with respect to the other items. ' +
'Thus an item with a factor of 2 will take twice as much space as an item with a factor of 1.' +
'Restart app to see changes.'),
},
};
return this.metadata_;