You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Zoom factor is saved to private setting
https://github.com/laurent22/joplin/pull/2165#issuecomment-565258704
This commit is contained in:
@ -115,7 +115,8 @@ class Application extends BaseApplication {
|
|||||||
{
|
{
|
||||||
const MIN = 0.3;
|
const MIN = 0.3;
|
||||||
const MAX = 3;
|
const MAX = 3;
|
||||||
const zoomFactor = Math.max(MIN, Math.min(MAX, action.zoomFactor));
|
const zoomFactor = Math.round(Math.max(MIN, Math.min(MAX, action.zoomFactor)) * 100) / 100;
|
||||||
|
|
||||||
newState = Object.assign({}, state);
|
newState = Object.assign({}, state);
|
||||||
newState.windowContentZoomFactor = zoomFactor;
|
newState.windowContentZoomFactor = zoomFactor;
|
||||||
}
|
}
|
||||||
@ -261,6 +262,17 @@ class Application extends BaseApplication {
|
|||||||
this.updateEditorFont();
|
this.updateEditorFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (action.type == 'SETTING_UPDATE_ONE' && action.key == 'windowContentZoomFactor' || action.type == 'SETTING_UPDATE_ALL') {
|
||||||
|
const zoomFactor = (action.value || action.settings.windowContentZoomFactor) / 100;
|
||||||
|
|
||||||
|
if (zoomFactor !== store.getState().windowContentZoomFactor) {
|
||||||
|
this.store().dispatch({
|
||||||
|
type: 'WINDOW_CONTENT_ZOOM_FACTOR_SET',
|
||||||
|
zoomFactor: zoomFactor,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (['EVENT_NOTE_ALARM_FIELD_CHANGE', 'NOTE_DELETE'].indexOf(action.type) >= 0) {
|
if (['EVENT_NOTE_ALARM_FIELD_CHANGE', 'NOTE_DELETE'].indexOf(action.type) >= 0) {
|
||||||
await AlarmService.updateNoteNotification(action.id, action.type === 'NOTE_DELETE');
|
await AlarmService.updateNoteNotification(action.id, action.type === 'NOTE_DELETE');
|
||||||
}
|
}
|
||||||
@ -295,6 +307,7 @@ class Application extends BaseApplication {
|
|||||||
|
|
||||||
if (action.type === 'WINDOW_CONTENT_ZOOM_FACTOR_SET') {
|
if (action.type === 'WINDOW_CONTENT_ZOOM_FACTOR_SET') {
|
||||||
webFrame.setZoomFactor(newState.windowContentZoomFactor);
|
webFrame.setZoomFactor(newState.windowContentZoomFactor);
|
||||||
|
Setting.setValue('windowContentZoomFactor', newState.windowContentZoomFactor * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -513,6 +513,16 @@ class Setting extends BaseModel {
|
|||||||
|
|
||||||
'camera.type': { value: 0, type: Setting.TYPE_INT, public: false, appTypes: ['mobile'] },
|
'camera.type': { value: 0, type: Setting.TYPE_INT, public: false, appTypes: ['mobile'] },
|
||||||
'camera.ratio': { value: '4:3', type: Setting.TYPE_STRING, public: false, appTypes: ['mobile'] },
|
'camera.ratio': { value: '4:3', type: Setting.TYPE_STRING, public: false, appTypes: ['mobile'] },
|
||||||
|
|
||||||
|
windowContentZoomFactor: {
|
||||||
|
value: 100,
|
||||||
|
type: Setting.TYPE_INT,
|
||||||
|
public: false,
|
||||||
|
appTypes: ['desktop'],
|
||||||
|
minimum: 30,
|
||||||
|
maximum: 300,
|
||||||
|
step: 10,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.metadata_;
|
return this.metadata_;
|
||||||
|
Reference in New Issue
Block a user